try{
String str = "select * from stocks";
stmt = conn.prepareStatement(str);
ResultSet rs = stmt.executeQuery();
while(rs.next())
jcbStock.addItem(rs.getString("stockID"));
}catch(Exception e){
e.printStackTrace();
}
I have this code in other class , and i want call it in my main class. Anyone can tell me how to do?