File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

oracle connection error

 
prachee apte
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i write code through jsp page ,it works properly that is a connection is established
table is created records inserted etc.
but when i write code i.e class ,the code gets compiled but when i try to run the programe
the following errors occur.

D:\prachi_java>java tryjdbc
java.sql.SQLException: Specified driver could not be loaded due to system error
1157 (Oracle ODBC Driver).
D:\prachi_java>java tryjdbc
java.sql.SQLException: Specified driver could not be loaded due to system error
1157 (Oracle ODBC Driver).
both these errors come when i write the code in try ,catch block.
the below given error comes when i write the code without try ,catch block.
D:\prachi_java>java tryjdbc
Exception in thread "main" java.sql.SQLException: Specified driver could not be
loaded due to system error 1157 (Oracle ODBC Driver).
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:4089)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:4246)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:1136)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:1
48)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:167)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at tryjdbc.main(tryjdbc.java:23)
 
Shankar Narayana
Ranch Hand
Posts: 134
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Check whether the classes12.zip file , which contains the oracle driver is in your classpath or not.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prachee,
The first part of your post has me confused. But in any case, according to the error details you have posted, it appears that the JVM cannot find the "Oracle ODBC Driver". For your information, this driver can be downloaded from the following Web page:
http://otn.oracle.com/software/tech/windows/odbc/index.html
Good Luck,
Avi.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic