This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

oracle connection error  RSS feed

 
Greenhorn
Posts: 1
  • 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)
 
Ranch Hand
Posts: 134
  • 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.
 
Ranch Hand
Posts: 1141
1
Java Oracle
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!