wood burning stoves 2.0*
The moose likes JDBC and the fly likes JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC" Watch "JDBC" New topic
Author

JDBC

zena sam
Ranch Hand

Joined: Apr 26, 2002
Posts: 41
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!!
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
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 ...
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

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


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC
 
Similar Threads
Unexpected result
How to use Like statement for int column?
Hibernate and Jdbc
fetching records page/page
Good Forums for java?