Hi,
I am using MS access for database.
I am using java as the programming language and able to connect to the database and insert the values into the database.
The following is the code used for inserting the values into the database:
public void storeDB (String insertSQL){
try {
Statement st = dbConn.createSt atement();
st.executeUpdat e(insertSQL);
} catch (Exception e) {
System.err.prin tln("Got an exception! ");
System.err.prin tln(e.getMessag e());
}
}
This method is always called from main function whenever I am inserting some values into the database tables.
Now I need to perform "Select" statement where I would like to select some values from the database rows depending on the condition and then either store or return that value to my main program.
generally st.executeQuery (Select * from table_name) always returns a result set.
But I am extracting a set of integer values from a database table and would like to return each of these values or store them in a temporary variable.
How can I do that.
Pls help!!
Thanks!!
I am using MS access for database.
I am using java as the programming language and able to connect to the database and insert the values into the database.
The following is the code used for inserting the values into the database:
public void storeDB (String insertSQL){
try {
Statement st = dbConn.createSt atement();
st.executeUpdat e(insertSQL);
} catch (Exception e) {
System.err.prin tln("Got an exception! ");
System.err.prin tln(e.getMessag e());
}
}
This method is always called from main function whenever I am inserting some values into the database tables.
Now I need to perform "Select" statement where I would like to select some values from the database rows depending on the condition and then either store or return that value to my main program.
generally st.executeQuery (Select * from table_name) always returns a result set.
But I am extracting a set of integer values from a database table and would like to return each of these values or store them in a temporary variable.
How can I do that.
Pls help!!
Thanks!!
Comment