Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connecting to Oracle 9i using Java

843854Mar 8 2004 — edited Mar 8 2004
How do i connect to an Oracle database thru Java code.. ?
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:his", "scott", "tiger");
Statement s=conn.createStatement();

I think i'm doing something wrong in the parameters to the getConnection() method...how do i find my Oracle SID....Any help wud be appreciated. Thanks !
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2004
Added on Mar 8 2004
2 comments
278 views