• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

loading registering driver twice with different Database driver

 
priyanaka jaiswal
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Does Loading and registering driver twice with two different database driver gives compile-time error?
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Registering any number of different database drivers should be fine. What compile-time error you get?
 
priyanaka jaiswal
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after loading and registering different type of driver can we can create connection for all?
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works roughly like this: when you are creating a connection, you're providing a connection string. Java "asks" all the registered drivers (by calling some methods of these drivers) whether they can handle such a string; the first driver that can handle it is used to create the connection from it.

So it is possible to create connections using several different drivers, if you use proper connection strings. I've done this in several applications without any problem.
 
priyanaka jaiswal
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Martin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic