Forums Register Login

JDBC driver

+Pie Number of slices to send: Send
Dear All,

Can we load more than one JDBC driver in my program?If yes, how can it be possible?If any one did, could you pls share any sample code if you have?

Alternatively ,will it throw outofMemory exception?

Thanks in Advance,
Senthan
+Pie Number of slices to send: Send
Definitely, I don't really see what your worry is. You can load multiple drivers to connect to multiple different databases.
+Pie Number of slices to send: Send
Do you know how to load one JDBC driver? You use Class.forName("...") and open a connection using (for example) DriverManager.

There's nothing that will stop you loading two different JDBC drivers in the same program. Just do Class.forName("...") for both drivers. If you get a connection using DriverManager, it will choose the appropriate driver based on the JDBC URL that you're passing it.

Why whould you think this would throw an OutOfMemoryError? That doesn't have anything to do with JDBC drivers in general.
+Pie Number of slices to send: Send
Hi Scott/Jesper,

Thanx a lot for our valuable response..

Kind Regards,
Senthan
+Pie Number of slices to send: Send
 

Originally posted by Vandiyadevan senthan:
Alternatively ,will it throw outofMemory exception?



Weeelll, I'd say it's possible. Heck, anything is possible.
Depending on the driver type used it may use more or less memory in your application. I the days we had use the Oracle Type-2 driver, our connection pools used a large amount of memory (about 50Mb when machines usually had 128 or 256 physical). It's not so bad now using the type-4 driver.

That's really just an anecdote. My real answer is similar to Jespers: If it's a problem, worry about it, otherwise don't worry about it
What's that smell? Hey, sniff this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 863 times.
Similar Threads
Connecting to MS SQL Server 2000 Personal Edition
different drivers
Oracle 10G
JDBC for DBase III
Jboss -DBMS
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 06:28:23.