JB8+ORACLE9i's jdbc database connection problem
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   william_shen
Posted On:   Friday, May 30, 2003 11:35 PM

look here! I use jdbc to connect oracle9i database in jb8. i have add jdbc's driver and set classpath. my program is: public class MyTestJDBC { String sDBDriver = "oracle.jdbc.driver.OracleDriver"; String sConnStr = "jdbc:oralce:thin:@william:1521:WILLIAM"; String user = "sys"; String pwd = "sys"; Connection connect = null; ResultSet rs = null; public MyTestJDBC() { ry{ DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); connect = DriverManager.getConnection(sConnStr); Statement stmt = connect.createStatement(); rs = stmt.executeQuery("insert into test(USERID, PASSWORD) val   More>>

look here!
I use jdbc to connect oracle9i database in jb8.
i have add jdbc's driver and set classpath.
my program is:
public class MyTestJDBC {
String sDBDriver = "oracle.jdbc.driver.OracleDriver";
String sConnStr = "jdbc:oralce:thin:@william:1521:WILLIAM";
String user = "sys";
String pwd = "sys";
Connection connect = null;
ResultSet rs = null;

public MyTestJDBC() {
ry{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
connect = DriverManager.getConnection(sConnStr); Statement stmt = connect.createStatement();
rs = stmt.executeQuery("insert into test(USERID, PASSWORD) values('9', '2')");
connect.close();
}
catch(Exception e){
System.err.println(e.getMessage());
}

}
public static void main(String[] args){
MyTestJDBC test = new MyTestJDBC();
}
}

The problem is:
No suitable driver

who can help me??

   <<Less

Re: JB8+ORACLE9i's jdbc database connection problem

Posted By:   Santtu_Vuori  
Posted On:   Tuesday, June 3, 2003 02:34 AM

Well, at least the connection string has a typo:
"jdbc:oralce:thin:@william:1521:WILLIAM"
should be "jdbc:oracle:thin:@william:1521:WILLIAM"

l and c have swapped places.

Rgds,
/Santtu
About | Sitemap | Contact