Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception while testing JDBC connection  RSS feed

 
somashaker goud
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Below is my sample code to test JDBC connection. Earlier it used to work.




but i dont know what went wrong I am getting below exception.

 
Paul Clapham
Sheriff
Posts: 22487
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Line 11 says "I'm going to use Sun's antique JDBC-ODBC driver".

Line 13 says "Connect to that driver using this Oracle JDBC URL".

Evidently the JDBC-ODBC driver doesn't understand what to do with that, so it throws an exception. I'd suggest choosing one driver or the other and writing the appropriate code for that driver.

(And it isn't clear to me what part Spring plays in this problem, so I'll put the post into the JDBC forum as well. It might get better answers there.)
 
somashaker goud
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul for your help !
 
Dave Tolls
Rancher
Posts: 2914
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Paul says, that driver hasn't seen any work done on it for over 15 years, and even then it was only intended as an example of a JDBC Driver and not really supposed to be used.

Any modern database has a JDBC Driver written specifically for it, so you should always find the driver related to the db you are using.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!