File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes How to setup JDBC:ODBC with a JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to setup JDBC:ODBC with a JTable" Watch "How to setup JDBC:ODBC with a JTable" New topic
Author

How to setup JDBC:ODBC with a JTable

Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

So I am trying to set up a Bridge to an Access Database for my JTable to read the data... I am using Netbeans GUI and when given the choices everyone but the Oracle ones were missing the Drivers, and the JDBC:ODBC Bridge only had my F:\ Drive listed... I had a successful test, but when I try to check out the tables there is nothing... The Java DB Derby works fine, but I'm not sure if I'm missing a Driver or if there is something else wrong... I know there are tables because I can make a connection and get the data elsewhere....

Any help would be appreciated, thanks!
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

I am sure i have read in a previuos post that the ODBC bridge presumes the database is on your local machine.
This might be a line of investigation (if it isn't on there)
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Wendy Gibbons wrote:I am sure i have read in a previuos post that the ODBC bridge presumes the database is on your local machine.
This might be a line of investigation (if it isn't on there)


Well 1 it doesn't have to be on your machine(but it will be very slow), 2 I was just talking about the drivers, not trying to use it to access something online, and how to get this JDBC connection to connect to a JTable...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

This must be a question about Netbeans, isn't it? Because normally you don't just "connect" a database driver with a JTable; there's a bunch of steps including getting a ResultSet from the database, making a table model from that ResultSet, and making that table model be the model for your JTable. (I'm sure you can find that pre-packaged on the web, your google keywords would be ResultSet table model.) But it's possible that Netbeans has something like that in its GUI designer. So was that what you were looking for? You said something about a "successful test" but I couldn't quite understand what you were testing. Which may well be because I don't know anything about Netbeans.

So if you think this post should be moved to the IDE forum, where people who know about Netbeans might see it, just let us know.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

Paul Clapham wrote:This must be a question about Netbeans, isn't it? Because normally you don't just "connect" a database driver with a JTable; there's a bunch of steps including getting a ResultSet from the database, making a table model from that ResultSet, and making that table model be the model for your JTable. (I'm sure you can find that pre-packaged on the web, your google keywords would be ResultSet table model.) But it's possible that Netbeans has something like that in its GUI designer. So was that what you were looking for? You said something about a "successful test" but I couldn't quite understand what you were testing. Which may well be because I don't know anything about Netbeans.

So if you think this post should be moved to the IDE forum, where people who know about Netbeans might see it, just let us know.


Thanks Paul as always for your respectful and good responses. I figured it might be a direct Netbeans issue. You basically bind a data source(JDBC is a choice, then some "Java Derby" client as one) but it didn't work for either..... Maybe I will look into this result set, I am new to JTables, so this is an issue with that overall.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

Though it is connected to Netbeans, there certainly can be an issue with the driver. ODBC drivers should not be used if at all possible. There definitely are thin JDBC drivers for Oracle, try using them.

Edit: I misread the question and thought it is about Oracle database. Thanks Wendy for pointing the mistake out.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

Martin Vajsar wrote:Though it is connected to Netbeans, there certainly can be an issue with the driver. ODBC drivers should not be used if at all possible. There definitely are thin JDBC drivers for Oracle, try using them.


when I looked 4 years ago, you had to pay huge amounts for an access jdbc driver.
 
wood burning stoves
 
subject: How to setup JDBC:ODBC with a JTable