Quote:
|
Originally Posted by Marcus_A
DB2 is not case sensitive when it comes to object names (like table name) so long as you leave the quotes off.
|
Otherwise said, the following should also work (and is a bit more readable):
Code:
void getData(int pIDvarFromAppl)
{
Statement st= createStatement();
String stSQl= "SELECT * FROM sampletb WHERE p_id = "+ pIDvarFromAppl;
return st.executeQuery(stSQL);
}
Also, consider replacing "SELECT *" by an explicit SELECT of the columns you want.
For one thing, this will save you surprises when the table would ever be modified to have more columns;
and also, this will improve the program's readability because of the better visibility (and order) of the column names.
And finally, in case your program doesn't need all table columns, it will improve the performance.