Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-07-2009
Member
 
Join Date: Oct 2008
Posts: 79
How to retrieve data from a jTable in Java and MS access

I am trying to retrieve data from a jTable with the instruction downloaded from the internet, the data array which i have taken is an object arrary as required for a table. I have also tried using MS Access database the requirement was same to populate data from database into JTable in Netbeans and we want to retrieve and display all the data in a JTable component using NetBeans IDE. And of course it doesn't work. Any suggestions appreciated.
Reply With Quote
  #2  
Old 09-07-2009
Member
 
Join Date: Dec 2008
Posts: 161
Re: How to retrieve data from a jTable in Java and MS access

Create the table in MS Access and make sure you put the database file inside your NetBeans Project Folder. You need to configure Create database engine to retrieve data from the Access table. Then create the GUI with a JTable component inside it. Create a new JFrame Form, Add a JTable component onto the Frame. After inserting the JTable component, switch to Source view, we need to insert coding to retrieve data from database.
Reply With Quote
  #3  
Old 09-07-2009
Member
 
Join Date: Dec 2008
Posts: 183
Re: How to retrieve data from a jTable in Java and MS access

If you wanted to retrieve data from jTable using Java then the first thing you need to do is to store your data in a two-dimensional array. (Otherwise known as an array of arrays). I set the code nameofjtable.setModel(variable u specify) after the init() if the jtable so it would load immediately the contents.You also need to store your column headers in a one dimensional String[] array. Here i will provide you the very good tutorial about how to populate data. http://java.sun.com/docs/books/tutor...nts/table.html
Reply With Quote
  #4  
Old 09-07-2009
Member
 
Join Date: Jan 2009
Posts: 99
Re: How to retrieve data from a jTable in Java and MS access

Typically you don't know the number of rows in the table so you would create your DefaultTableModel using a Vector. You would populate the Vector with data from the ResultSet.Data is an object that contains string data for a table and I am trying to retrieve some table data. I thought that valueOf was a sort of universal function that could accomplish this. If you want to get fancy you you can check out Table From Database which uses a general purpose custom TableModel and does all the work for you.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to retrieve data from a jTable in Java and MS access"
Thread Thread Starter Forum Replies Last Post
Retrieve a web page content in java New ID Software Development 5 25-02-2010 04:09 AM
Print JTable with the help of java Coldman Software Development 3 25-11-2009 09:02 AM
Retrieve data from Access 2007 to Excel 2007 Markesh Windows Software 3 23-09-2009 08:20 AM
How to refresh data of Jtable in java sarmad_iu Software Development 1 28-05-2009 02:45 PM
How to access and retrieve data from HDD ? Caden Hardware Peripherals 3 21-02-2009 06:22 PM


All times are GMT +5.5. The time now is 12:07 PM.