resultset not give me data or not give me result
Sir I am use datasource and resultset with this code this code not give me error
Sir I use one button and one text box that name is m1 I try move resultset value into mt my textbox but resultnot give me data
My code
public String button1_action() {
Connection conn = null ;
Statement sqlStatement = null ;
ResultSet rs = null ;
try {
javax.naming.Context ctx = new javax.naming.InitialContext() ;
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/Travel") ;
conn = ds.getConnection() ;
// setup the connection
conn.setAutoCommit(false) ;
// execute the query
sqlStatement = conn.createStatement() ;
rs = sqlStatement.executeQuery("select count(*) from TRIP" ) ;
rs.next() ;
int rows = rs.getInt(1) ;
m1.setValue(Integer.toString(rows));
conn.commit() ;
info("Rows in table TRIP: " + Integer.toString(rows)) ;
}
catch (Exception ex) {
error("Error counting rows: " + ex.getMessage() );
}
return null;
}
please give me idea how I get data in textbox form result

