Help wanted for java - MS access

Discussions

General J2EE: Help wanted for java - MS access

  1. Help wanted for java - MS access (1 messages)

    I have NO problems in conneting to Ms acees thro java jdbc-odbc bridge.
      I get a result set and i read the data from say column c1.
    Then say i try to read the same c1 data agin in the very next line, i get an 'no dat afound error'
      Here is the part of code ..
      
    while(rs.next())
    {
        System.out.print(rs.getString("UserId"));
        System.out.print(rs.getString("UserId"));
    }

    I get output for 1st system.out, but with the second one i get an error " no data found"
    Any ideas Gurus???

    Thanks
     
  2. Help wanted for java - MS access[ Go to top ]

    This is a while loop and will keep repeating until there is nothing left in the ResultSet

    Modify your code to be:

    while(rs.next())
    {
        System.out.print(rs.getString("UserId"));
    }

    and you will loop through the ResultSet correctly.