Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Rani Singh   on Sep 29 In Java Category.

  
Question Answered By: Corbin Jones   on Sep 29

Oracle uses a jdbc URL of this form (presuming you are using the thin
drivers)
jdbc:oracle:thin:[<user>/<password>]@//<host>[:<port>]/<service>
where port is presumed to be 1521 if not specified

creating a connection  goes somethig like this

String url = "jdbc:oracle:thin:@//mydbhost/myschema";
String username = "dbuser";
String password= "dbpassword";

Class.forName("oracle.jdbc.OracleDriver");
Connection connection = DriverManager.getConnection(url, username,
password);

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Connection string for oracle database Or get search suggestion and latest updates.


Tagged: