Code example for ResultSet

Methods: first, getString

0
try{ 
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/cutPlanner","root","");
Statement st = conn.createStatement();    
ResultSet rs = st.executeQuery("SELECT rychlost FROM druhpapiru WHERE cislopap="+idpap+";");
   
 rs.first();
 doba=delkrol/(Integer.parseInt(rs.getString(1)));     
      
}catch(Exception e){ System.out.println("Chyba volani, neprihlaseno");
   
    } 
     
} 
}