Oracle 9i, 9.2.0.1.0., RHEL 2.1 AS, jdk 1.3 [message #444010] |
Thu, 18 February 2010 06:09 |
jimit_shaili
Messages: 237 Registered: June 2006 Location: India, Ahmedabad
|
Senior Member |
|
|
Dear Friends
here i'm posting the piece of my java code. Actually i want to know am i using the bind variable properly through java to connect oracle database. My application developer not able to give proper answer. please suggest me the improvement for below java code[in context of using bind variable].
public ResultSet fetchSalesOrderList(String CompCd,String ExecDate,String FactCd)
{
String vSQL="";
try
{
vSQL ="select salesorderno,preparationdate,stockistcd from sales_master where compcode=? and factorycode=? and exedate=?";
PreparedStatement PrepStat = dbConn.prepareStatement(vSQL);
PrepStat.setString(1, CompCd);
PrepStat.setString(2, FactCd);
PrepStat.setString(3, ExecDate);
this.getConnection();
return prepStat.executeQuery();
}catch(Exception e){
System.err.println("From clsDeliveryChallanB.fetchSalesOrderList :"+e);
return null;
}
}
Regards
Jimit
|
|
|
|
Re: Oracle 9i, 9.2.0.1.0., RHEL 2.1 AS, jdk 1.3 [message #444017 is a reply to message #444010] |
Thu, 18 February 2010 06:20 |
jimit_shaili
Messages: 237 Registered: June 2006 Location: India, Ahmedabad
|
Senior Member |
|
|
Dear Michel
whenever we asked them about using bind variable in java code they just reply everything is okay.they just send us the above code for verification. i cross checked on asktom but i'm little bit confused about code, so i asked it here in this forum.
regards
jimit
|
|
|
|