• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDBC  RSS feed

 
Tokai Chatterjee
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right now I am connecting with the Oracle through JDBC.I need to know the Oracle Error Code in case of a SQLException.Will the getErrorCode() work in this case?Within the catch block I need to detect what type of database error is occuring.Depending on that,I will proceed further.Please suggest me the solution.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The solution is to write the code, provoke an error, and see yourself. (Should be done in 5 minutes).

Note that there is a JDBC-section, and an Oracle/OAS section.

The 'advanced' section is for advanced questions.
 
Hareesh Ram Chanchali
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
get the exception and use that getErrorCode() method with e
U will get some ORA number by which you can understand type of exception

It will work in Catch block
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!