Results 1 to 4 of 4

Thread: How to retrieve data from a jTable in Java and MS access

  1. #1
    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.

  2. #2
    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.

  3. #3
    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

  4. #4
    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.

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,483,128.38648 seconds with 17 queries