Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Connection string for oracle database

  Asked By: Rani    Date: Sep 29    Category: Java    Views: 1035
  

Im new in EJb and i want to do something with Beans Managed persistente.
How can i connect witha oracle database fron a BMP ejb ?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Corbin Jones     Answered 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);

 
Answer #2    Answered By: Taylor Evans     Answered On: Sep 29

sorry, im confused, i dont have an oracle  database at work, is MS SQL SERVER 7.
Which wold be be te connection  string for that BDGS ?

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




Tagged: