suresh
suresh

Reputation: 57

Connection properties along with JDBC URL for oracle thin driver

How to supply DB connection properties along with JDBC URL when we used Oracle thin driver

Upvotes: 5

Views: 3563

Answers (1)

Jan
Jan

Reputation: 13858

Oracle has a very good documentation on that point.

It boils down to:

Create a Properties file, add the connection properties you need and add them into your call to

 getConnection(String URL, Properties info);

Given your comment, you could try the following - but I could find no documentation that this connection property is actually available on the thin driver. This document that points to that driver suggests it's part of the deprecated weblogic oracle driver.

 Properties p = new Properties();
 p.setProperty ("user", youruser);
 p.setProperty ("password", yourpass);
 p.setProperty("EnableCancelTimeout", "true");

 Connection con = DriverManager.getConnection(jdbc:oracle:thin:@<host>:1521:<SID>), p);

Upvotes: 1

Related Questions