ResultSet_getMetaData2
  • MySQL ::  emp table
  • A ResultSet object sets  a cursor pointing to its current row of data.
  • To begin with the cursor is positioned before the first row; and   next() method moves the cursor to the next row, and  returns false when there are no more rows in the ResultSet object.
  • for details visit this link Oracle-ResultSet.html
  • ResultSetMetaData : Retrieves the number, types and properties columns, stored in ResultSet.
  •  // connection >>statement >> Resultset
  • Passing  Resultset as a parameter
Code Snippets:
  •   Connection strings :
    //PostgreSQL ::
    //String dbURL = "jdbc:postgresql://localhost:5432/pgsdemo1";
    //String user = "postgres"; String pwd = "postgre_manas9";
    //MySQL::
    String dbURL = "jdbc:mysql://localhost/test?";
    String user = "Manas9"; String pwd = "Manas9237";
     
  • connect to db and
  • ResultSetMedata ::getMetadata, getColumnCount

  • Sending Resultset as a parameter:
  • while loop :: iterating Resultset
Complete Code : ResultSet_getMetaData2.txt
Runtime Views: