I'm currently trying to implement a SSL connection from the jdbc-pool of our java application server to our Oracle database.
We're using Payara (based on glassfish) as our application server. On there I created a JDBC-connection pool that offers a connection to the database. The goal ist to encrypt this connection.
The used ojdbc driver version is 11-21.1.0.0.
Sadly I only found guides on how to encrypt payara JDBC-pool connections to postgres or mysql databases, not to oracle ones.
The only thing I found was that apparently the pool has to talk to port 2484 on the database (link).
Does anyone have any experience with how to solve this problem?
What parameters, aside from port, do I have to set in the advanced properties of the jdbc-pool?
Any help would be highly appreciated!
Can you check the JDBC Developer's guide for security information?
Check out www.oracle.com/jdbc for other resources.
I am trying to do some automation in mysql and redshift usin Java (JDBC) preferred. I usually use a remote desktop connection to connect, from there I use mysql workbench and aginity workbench to access mysql and redshift repectively. I have authentication for both as well as the aws urls.Also the aginity license. My goal is to connect Java running outside the remote desktop, to query some data fro mthe databases and compare them. I would like to know how to connect to both databases, as well as the documentation where I can learn more. I familiar with all three technologies , I just now sure how to connect them together. I am lost ,kidnle help. Thanks in advance.
I need to retrieve data from the database. I have the database name, username, password, servername, but I don't have the software installed in my machine. Can I connect to the db and retrieve the data from the db from database from Java code?
you need to have database drivers atleast like ODBC or JDBC drivers on your system where application runs to access the DB from other machine.
Yes. The jdbc driver .jar can be used stand alone. It logs a warning about a missing .dll, but that can be ignored unless you need to use windows auth.
From Java, it's easy as long as there is some kind of driver installed (for example, ODBC.) Try Googling connecting to db using odbc.
im using Eclipse Helios Java EE IDE for Web Developers,Version: 1.3.0. connection with derby embeded jdbc driver is workin fine but i cannot make connection with derby client jdbc driver... what should i do to make it work,please help me...
connection with derby embeded jdbc driver is workin fine but i cannot make connection with derby client jdbc driver
Providing details (what you did, what didn't work, etc) is generally useful to get good answers. Here are some things to check though:
make sure derbyclient.jar is on the classpath
make sure you are using org.apache.derby.jdbc.ClientDriver as driver class
make sure the URL follows the following format jdbc:derby://<host>:<port>/<database>
make sure the network server has been started(!)
Oracle has this concept of allowing database users to be identified by the operating system user who is running the program that is connecting to Oracle. See here.
This allows you to do, as that user on a unix machine for example, a command such as:
sqlplus /
I am attempting to write a Java program for Oracle 10.2 which connects without a username or password. The obvious choice of url:
jdbc:oracle:thin:/#localhost:1521:MYDBSID
doesn't work, giving an error (Sorry I don't have the error available right now).
I have attempted many other forms of doing this as well, but with no luck.
Does anyone have any suggestions on how I can connect a Java program to Oracle using the OS identification method?
The JDBC Thin driver is a 100% pure Java implementation that cannot collect the needed information from the operating system.
The JDBC OCI driver can do this! Use jdbc:oracle:oci8:/#MYDBSID, it will require that the Oracle driver be installed on that machine, not a problem if this is a server (and is faster to boot and supports many more features than the thin driver)
The jdbc driver that oracle ships does NOT have the capability of gathering the OS username and password from the URL that you provide it. Suppose, there are 3rd party JDBC driver providers for ORACLE, one of them might provide the functionality that you're asking for. you should google around.
Thanks to those that answered. We've gone with the OCI driver.
I did find documentation to suggest that Oracle 11g does support OS user authentication via the thin driver though:
http://www.orindasoft.com/public/Oracle_JDBC_JavaDoc/javadoc1110/oracle/jdbc/OracleConnection.html#CONNECTION_PROPERTY_THIN_VSESSION_OSUSER
I don't have an 11g setup to test this on, so I can't be certain this works.
OS authentication support in the JDBC thin driver was added in 11g (you can download the JDBC thin driver from 11.2.0.4 on OTN).
Note that you have to allow remote OS authentication on the server (over TCP) otherwise it will only work with sqlplus using IPC or BEQ locally. In your init.ora file, add this:
REMOTE_OS_AUTHENT = TRUE
Then if you user is "osuserdemo" on the client machine, create a database user like this and restart the DB:
CREATE USER OSUSERDEMO IDENTIFIED EXTERNALLY;
GRANT CONNECT,CREATE SESSION,RESOURCE TO OSUSERDEMO;
And the JDBC thin driver should be able to connect without any username or password.
It's worth noting that this feature - considered as highly unsecured - has been de-supported in 12c.
If you're accessing Oracle from a J2EE appserver, you could achieve a similar end by using JNDI to acquire a datasource.
The 11g thin driver can connect using Kerberos authentication.
See Connect to an Oracle database using Kerberos
try following
jdbc:oracle:thin:username/password#localhost:1521:MYDBSID
you need to specify the account information
sqlplus / as sysdba on a unix machine which go through the operation system autentication
jdbc:oracle:oci:# works with ojdbc6.jar and Oracle 11g2