Forums Register Login

JDBC

+Pie Number of slices to send: Send
Hi,
I have a few questions regd JDBC/SQL?
can we connect to multiple databases from one application using JDBC?
how can we verify the results expected from a query with the results produced....if the expected results are stored in a excel sheet?
Thanks in Advance!!
+Pie Number of slices to send: Send
ONE: Yes, you can connect to multiple databases, and they can be of different types. So may have a connection to Sybase, two to Oracle, and one to MySQL. Just make sure you register all of the relevant drivers and then call DriverManager.getConnection(...) to create a connection to each database as needed. You just have to keep track of which connection is tied to which database so you process queries against the right database ...
TWO: How can you verify the results? Well, I guess you can save the results in any form you deem appropriate and compare it against what you expect. But if you submit the correct query, you'll get the correct results. JDBC has been in use for several years now and seems to work well ...
+Pie Number of slices to send: Send
There's also at least one Excel JDBC driver. Or ability to read Excel using the JDBC-ODBC bridge, I forget which.
So you could do the "open more than one database" trick and one of the "databases" would be the Excel spreadsheet.
Just don't ask me how. I know it's possible, but for practical details, I'd have to RTFM
Police line, do not cross. Well, this tiny ad can go through:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 866 times.
Similar Threads
fetching records page/page
Unexpected result
Good Forums for java?
Hibernate and Jdbc
How to use Like statement for int column?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:45:30.