Hi, i'm having trouble in filling a jtable with data

hi, i'm having trouble in filling a jtable with data, but the real problem is that i have stablished a JDBC connection throught the windowsxp ODBC to my database written on microsoft access platform, so i created my table
public CenterPanel(){
panel = new JPanel();
dataTable = new JTable(10,10);
dataTable.setBorder(BorderFactory.createLineBorder(Color.black,2));
panel.add(dataTable);
setLayout(new BorderLayout());
add(panel,BorderLayout.CENTER);
i can see the table on my driver, but i want to fill it by connecting to the database and fil the fields from the database, i have the code to connect and retrieve the fields but on the dos, i want to fill them in the table,
the code for accessing is
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     Connection conn1 = DriverManager.getConnection      ("jdbc:odbc:EHLAN",
                         "marius","svasdiga");
               Statement stmt1 = conn1.createStatement();
               Statement stmt2 = conn1.createStatement();
               ResultSet rs1 = stmt1.executeQuery ("select * from Appartment");
               System.out.println("App. Num, Stair Num, Elec. Num");
          while (rs1.next()) {
               System.out.print (rs1.getInt ("appnum") + ","+" ");
               System.out.print (rs1.getString ("staircase") + ","+" ");
               System.out.println (rs1.getInt("electrnum") );
ResultSet rs2 = stmt2.executeQuery ("select * from Person");
System.out.println("First Name, Last Name, Blood Type");
          while (rs2.next()) {
               System.out.print (rs2.getString ("namef") + ","+" ");
               System.out.print (rs2.getString ("namel") + ","+" ");
               System.out.println (rs2.getString("bloodType") );
so help me to fill this data to the table. thank you
yours sincerely,
marius ajemian

hi, i'm having trouble in filling a jtable with data, but the real problem is that i have stablished a JDBC connection throught the windowsxp ODBC to my database written on microsoft access platform, so i created my table
public CenterPanel(){
panel = new JPanel();
dataTable = new JTable(10,10);
dataTable.setBorder(BorderFactory.createLineBorder(Color.black,2));
panel.add(dataTable);
setLayout(new BorderLayout());
add(panel,BorderLayout.CENTER);
i can see the table on my driver, but i want to fill it by connecting to the database and fil the fields from the database, i have the code to connect and retrieve the fields but on the dos, i want to fill them in the table,
the code for accessing is
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     Connection conn1 = DriverManager.getConnection      ("jdbc:odbc:EHLAN",
                         "marius","svasdiga");
               Statement stmt1 = conn1.createStatement();
               Statement stmt2 = conn1.createStatement();
               ResultSet rs1 = stmt1.executeQuery ("select * from Appartment");
               System.out.println("App. Num, Stair Num, Elec. Num");
          while (rs1.next()) {
               System.out.print (rs1.getInt ("appnum") + ","+" ");
               System.out.print (rs1.getString ("staircase") + ","+" ");
               System.out.println (rs1.getInt("electrnum") );
ResultSet rs2 = stmt2.executeQuery ("select * from Person");
System.out.println("First Name, Last Name, Blood Type");
          while (rs2.next()) {
               System.out.print (rs2.getString ("namef") + ","+" ");
               System.out.print (rs2.getString ("namel") + ","+" ");
               System.out.println (rs2.getString("bloodType") );
so help me to fill this data to the table. thank you
yours sincerely,
marius ajemian

Similar Messages

  • Having trouble connecting computer to TV with sound

    I have a 2010 macbook pro and a samsung LN40B550 LCD HDTV - having trouble connecting computer to TV with sound - I'm not sure which connectors I need and have purchased a few that aren't working (HDMI: DVI cable & Mini - DP to DVI adaptor).  Any help would be greatly appreciated. Thanks

    Sorry to tell you that DVI does not support sound.  You either have to use a HDMI cable (with the appropriate adapter) or tap your audio output port with a 'Y' type cable configuration for sound.
    Ciao.

  • I am having trouble connecting my iPad mini with my lap top that run Xperia

    I am having trouble connecting my iPad mini with my lap top that run Xp

    Hi..I've had a variant of this problem; my internet was accessible but my devices on wifi could not see the PC on Lan. That meant no iTunes syncing, Airplay from iTunes etc.
    Dlink has a strange default setting that isolates Wifi & Wired connections into different subnets.I'm assuming you have DHCP setup on your router and you're PC or MAC has internet access via the same router. Try the following steps to see if this solves the problem for you-
    1. Go to Setup -> Local Network  and Uncheck the box that says 'Configure the second IP Address and Subnet Mask for LAN' - Hit Apply
    2. Go to Wireless -> Wireless Basic and Uncheck 'Enable MultiAP Isolation' - Hit Apply
    3. Restart your Router
    Let me know if this solves your problem. I've been frustrated by my problem for months & had nearly given up.
    J

  • I have an iphone 4 just updated my iTunes and now i'm having troubles to sync my iPhone with iTunes... can anyone help me plz?

    i have an iphone 4 just updated my iTunes and now i'm having troubles to sync my iPhone with iTunes... can anyone help me plz?

    You need to do as provided. If no change after restoring as a new iPhone or not from the backup, the iPhone has a hardware problem.

  • Having trouble maintaining remote desktop connection with Mavericks.  What is this about needing RDC 3.7.1 with Mavericks.  I downloaded RDC 3.7.1 but it does not replace RDC 2.1.0 previously installed.

    Having trouble maintaining remote desktop connection with Mavericks.  What is this about needing RDC 3.7.1 with Mavericks.  I downloaded RDC 3.7.1 but it does not replace RDC 2.1.0 previously installed

    Lucky you, it did not work for many users (which as it should be) so MS produced a new version, for ML and Mavericks.
    It's in the App Store, for free.
    FYI, I assume that you were attempting to post a picture, no one can see it (except maybe you) because it is on your computer rather than the forum server.
    file:///Users/dbrant/Desktop/About%20Apple%20Remote%20Desktop%203.7.1.webloc
    Use the small camera icon in the editor toolbar to post it.
    It also looks like you attempted to use Apple Remote Desktop, which does not do Windows.

  • I seem to be having trouble "save" or "save as" with jpg files. Any Suggestions?

    I seem to be having trouble "save" or "save as" with jpg files. Any Suggestions?

    By the way, a full uninstallation and reinstallation is a bit heavy-handed and is not always necessary.
    Keep in mind that with Photoshop CS6 the Plug-ins subfolder is now normally completely empty.  So to undo an inappropriate copy of plug-ins generally you can just delete all the copied plug-ins and that will restore proper Photoshop CS6 operation.
    Then you can reinstall your needed 3rd party plug-ins one by one.
    -Noel

  • I seem to be having trouble "save" or "save as" with jpg files.

    I seem to be having trouble "save" or "save as" with jpg files. Any suggestios?

    Awol2010 wrote:
    Any suggestions?
    Yes. - clarify what trouble(s) you are having.

  • I'm having trouble synching my Outlook Calendar with my iPhone.   We use Outlook in my office so it's the only Calendar I use, so I can share inter-office  Used to use Mobile Me and I terminated that. Prior to this Outlook synched fine.  Prior to having m

    I'm having trouble synching my Outlook Calendar with my iPhone iniTunes
    We use Outlook in my office so it’s the only Calendar I use, so I can share inter-office
    Used to use Mobile Me and I terminated that. Prior to this Outlook synched fine.
    Prior to having my iPhone I only had one type of Calendar in Outlook
    I know have 'Calendar 5' on my Outlook, but that doesn't show up on my iPhone.
    iPhone does give me several other numbered Calendars – but no ‘Calendar 5’
    I need to figure a way to get all this synched correctly
    very frustrating!

    Take a look of this link, http://support.apple.com/kb/HT1701

  • Why am I having trouble signing in to iTunes with my AppleID? I change it

    Why am I having trouble signing in to iTunes with my AppleID? Once I go through the motions to reset my password on Apple's website & go back to iTunes, I still can't sign on. Should I have two passwords? Is there something I'm missing??

    Yep. Good point.
    To completely shut it down, even in the background, double click the home button to display the row of apps. Then press and hold the Facetime app until the app displays a minus sign. then touch the minus sign.
    The app is now stopped !

  • I am having trouble using my I phone with Icloud. I tried diabling it & all my contacts have been cancelled.

    I am having trouble using my I phone with Icloud. I tried diabling it & all my contacts have been cancelled.

    OK, I called Plantronics and it was an easy fix.  You need to hold down the volume up button and the power button on (on the headset) at the same time until the lights on the headset start flashing red and blue.  Then turn on the phone Bluetooth and it pairs up just fine.
    Thanks fo rthe help!!

  • Fill the LOV with data during the execution

    Hi
    I am using Oracle 10g
    I want to ask please if there is a way to fill the LOV with data during the execution
    so can I change the query specified in LOV wizard during the execution and get a new record set according to the value in the text boxes
    thank you for help

    You can use the SET_LOV_PROPERTY built-in to change the record group of the LOV and to create a new record group you can use the CREATE_GROUP_FROM_QUERY built-in.
    it will be something like this.
    RG_ID := FIND_GROUP('<record group name>');
      IF NOT ID_NULL(RG_ID) THEN
           DELETE_GROUP(RG_ID);
      END IF ;
      RG_ID := CREATE_GROUP_FROM_QUERY('<record group name>', '<your SQL statement here>');
      POP_GROUP := POPULATE_GROUP('<record group name>');
      SET_LOV_PROPERTY('<LOV name>', GROUP_NAME, '<record group name>');Use the online help for more information about these built-ins.
    Tony

  • I'm having trouble connecting my Intel iMac with the internet using wifi router

    I'm having trouble configuring my iMac to accept a connection with my Telstra Elite mobile broadband Wifi router.
    The iMac's Wifi is turned on and the elite router is selected in the Wifi list with a tick.
    The router is turned on, and connected to the internet.
    I'm able to surf the net and collect emails using my MacBook Pro ( what I'm using now) and my iPad with no hassles by connecting them to the Telstra Elite Wifi router. But I'm unable as yet to get a connection using the iMac.
    The Telstra router accepts up to 5 simultaneous connections.
    At present the display on the router says that three devices are connected. They being the iPad, the MacBook Pro and the iMac.
    Can anyone help me out?
    Gregory

    hburgess3 wrote:
    I'm having trouble connecting my apple tv to the wifi on my campus. To connect to this wifi on a computer or iphone you have to install a program.
    Why?
    Contact the school IT department,

  • I am having trouble getting a powerpoint made with keynote to advance with the arrow keys

    I am having trouble getting a powerpoint made in keynote to advance using the arrow keys when I save it to a flashdrive.

    Hi Wayne,
    Thank you for this response.  I have tried this but when I start enterring $ amounts some, such as $6.00, go in OK others such as $4.00 appear as a date ie 4 Oct 12.  
    Kind regards
    Paul

  • I just had my logic board replaced. now im having trouble using the interent even with a strong connection and the internet is working on other devices!! please help me :(

    I just had my logic board replaced. i am now having trouble with using the interent even with a strong connection. all other devices are having no problem with the internet. please help

    Test while started in Recovery : if the problem persists, then it likely is a hardware issue.
    Resetting the System Management Controller (SMC) probably won't change anything, but you can readily do it before contacting the repairers.

  • Fill a table with data coming from an RFC

    Hello everyone:
    I've followed the Weblog "How many lines of java code did i write for a simple Web Dynpro?"
    /people/durairaj.athavanraja/blog/2004/10/17/how-many-lines-of-java-code-did-i-write-for-a-simple-web-dynpro
    I've called an RFC and created a table with data coming from it (which is also a table). My question is, if in this table there's a field named "UserType" there are two possible values for this field:
    "userA"
    "userB"
    How can I get the table only show me the "userA" registers? The RFC does return all of the users, but when filling the table, can I put an if-else somewhere on my code?
    Thanks a lot
    Alejandro

    Hi Alejandro,
    Referring to the link provided "The logic of the filter process is not implemented in Web Dynpro. The application developer must implement the action to be executed."
    We would have to implement the action onFilter in the controller implementation. Ideally, we fill the data retrieved from backend into a List (java.util.List) (this could be done on init of view) and then subset the list after meeting the criteria in the action handler(say
    onActionFilterData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent).
    Having done this, you may bind the output list back to the node (shown in table)
    Regards,
    Chaitanya

Maybe you are looking for

  • Can af:selectOneRadio initial selection be set to values from view object?

    Using JDeveloper 11.1.1.4 Hi all. I have a selectOneRadio on a data entry page which works well. Now I want to (if possible) use the selectOneRadio on an edit page--setting the choice initially to the values that were stored in a database table's rec

  • Word 2000 with SolMan and EWA issues

    Hi, Having a number of issues. It seems since updating SolMan to SP24 EHP1 i cannot open EWA reports in Word 2000 (updating to latest version is out of the question due to business politics). I have tried a number recomendations from OSS notes but no

  • Photoshop CS6 won't update camera raw 7.1

    I selected "Edit in Photoshop CS6" on a photo in Lightroom, and it told me I needed to update Camera Raw in Photoshop.  Being unable to update directly from Photoshop, I downloaded the update from Adobe.  Upon running the installer (as an administrat

  • Plant maintenance order settlement

    hi gurus activity hours confirmed on plant maintenance order 1. order Dr maintenance cost center Cr with internal activity allocation cost element. 2. actual activity price calculation 3. order settlement to cost center, at this time entry is Order b

  • Tracing scsi commands with dtrace / wrong ctf data on S-x86?

    This is probably a bug, either in the kernel's CTF symbol information, or in dtrace: I'm trying to trace scsi commands in the Solaris 10 b63 x86 kernel with dtrace, including any request sense data received for failed scsi commands. I've noticed that