Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc drivers

 
indira mandapati
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the driver name/url for oracle?
class.forName(?);
what is the url ?
DriverManager.getConnection(url,uid,passwd);
thanks,
Indira
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"indira",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Thanks.
Dave
 
Mahesh Mamani
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indira,
When using Oracle thin driver for connecting to the database,
String url= "jdbc:oracle:thin:@<ServerName>:<PortNumber>:<Database Name>";
where <PortNumber> is usually 1521.
Class.forName("oracle.jdbc.driver.OracleDriver");

Mahesh
[ Edited to remove ]
[ February 19, 2002: Message edited by: David O'Meara ]
 
Shin Hashitani
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Indira,
Oracle also has oci driver available. (At least in WebLogic) It's a Level-2 driver. In that case,
Properties prop = new Properties();
prop.put("user", "scott");
prop.put("password", "pass");
prop.put("db", "myDB");
Driver ociDriver = (Driver) Class.forName("weblogic.jdbc.oci.Driver").newInstance();
Connection connection = ociDriver.connect("jddbc:weblogic:oracle", prop);
In case of oci driver, you have to configure properties in tnsnames.ora file.

Shin Hashitani
[ Edited to remove ]
[ February 19, 2002: Message edited by: David O'Meara ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic