Results 1 to 3 of 3
  1. #1
    Stephen Douglas's Avatar
    Stephen Douglas is offline Senior Member
    Join Date
    Mar 2010
    Posts
    137
    Rep Power
    0

    Default Is resultset the mirror image of database table???

    I create a table as--
    Java Code:
    CREATE TABLE RMS_ACCOUNTSTORE (INVOICE_TYPE VARCHAR2(5) NOT NULL, CUSTOMER_NAME VARCHAR2(50) NOT NULL, CUSTOMER_ADDRESS VARCHAR2(100) NOT NULL, TIN_NUMBER VARCHAR2(50) NOT NULL, PRIMARY KEY (TIN_NUMBER));
    Then I fetched the contents of a database table into a ResultSet object...

    now my question is whether the order of columns in the resultset object will remain the same as the order of columns in a table in the database every time the resultset object is created ??
    :confused:
    The Quieter you become the more you are able to hear !

  2. #2
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by Stephen Douglas View Post
    now my question is whether the order of columns in the resultset object will remain the same as the order of columns in a table in the database every time the resultset object is created ??
    :confused:

    if you explicitly add your attributes in your select statement the order will remain the same like in the select statement every time the resultset is created. if you use select * i can't tell if the order is always the same but it should.

  3. #3
    Stephen Douglas's Avatar
    Stephen Douglas is offline Senior Member
    Join Date
    Mar 2010
    Posts
    137
    Rep Power
    0

    Default

    It remains same... but i am not sure if it alway be !
    explicitly add your attributes
    and hey.. by this did you mean ?? order by
    The Quieter you become the more you are able to hear !

Similar Threads

  1. Need help with mirror images for dr.java
    By outlawstar7788 in forum New To Java
    Replies: 1
    Last Post: 04-07-2010, 11:44 PM
  2. How to display database in table
    By tamnc in forum SWT / JFace
    Replies: 0
    Last Post: 03-15-2010, 06:57 AM
  3. Resultset to HTML Table
    By IDForums in forum JDBC
    Replies: 7
    Last Post: 01-15-2010, 07:45 AM
  4. Replies: 11
    Last Post: 02-20-2009, 03:10 AM
  5. Showing ResultSet in HTML table
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-27-2008, 09:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •