var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: need urgent help with PreparedStatement
i use db2 as database, jdbc 2.0 driver and jsp.
i have a prepared statement which looks like this :
query = "select id, name from t_department where id in (?) order by name";
i have a StringBuffer (selectedIDs) which consists of comma sepperated integers like :
216, 220, 230, 323, 432
it is not a string so the statement below gives an error :
using a Statement instead would solve the problem :
query = "select id, name from t_department where id in ("+selectedIDs.toString()+") order by name";
but wouldn't that compile a new statement every time, because the id-list (the comma sepperated values) changes with every request.
how can i solve this problem by using preparedstatement ?
any help will be appreciated
You can use the PreparedStatemet if you
always use the same number of parameters.
For instance if you know you always have 4 parmeters:
query = "select id, name from t_department where id in (?, ?, ?, ?) order by name";
pst = ...