aspose file tools*
The moose likes JDBC and the fly likes Displaying Oracle Data in a JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Displaying Oracle Data in a JTable" Watch "Displaying Oracle Data in a JTable" New topic
Author

Displaying Oracle Data in a JTable

Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
I've been struggling for the past three days with this task. It seems like it should be a standard thing to do, but I find examples hard to come by.
I want to display/edit/create information using a JTable where Oracle is the data source. Been trying to use the JDBCAdapter class that ships with Java, but it gives some errors I can't track down when trying to perform the update (I can display the data just fine):
Exception occurred during event dispatching:
java.lang.NullPointerException
at oracle.jdbc.driver.OracleResultSetMetaData.getValidColumnIndex(OracleResultSetMetaData.java:106)
at Oracle.jdbc.driver.OracleResultSetMetaData.getColumnType(OracleResultSetMetaData.java:305)
at JDBCAdapter.getColumnClass(JDBCAdapter.java:137)...
Does anyone know of good resources/examples to accomplish this.
Any help is appreciated.
Michael
Shekhar Sahay
Greenhorn

Joined: Oct 30, 2000
Posts: 2
Hi Michael
Are you trying to edit and insert data from the JTable? I have a working code, but here I just view the data. Let me know if this is what you are looking for and I'll email it to you.
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
Dear Shekhar,
I'd really appreciate that. Eventually I'll have to update/insert, but I'll take it one step at a time. Thank you.
My email is mhildner@afweb.com
But if anyone knows of some working code that will allow update/insert with JTable and Oracle, I could use it - it's driving me crazy trying to figure it out.
[This message has been edited by Michael Hildner (edited November 07, 2000).]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Displaying Oracle Data in a JTable