sql query like in java coding

hi there i need help for fix the coding.

since i would like to implement -->SELECT orders.stockcode,datetime,orderqty,price,ordertype,ordid,ordertotal FROM orders,company,portfolio WHERE datetime like '*20-SEP-2005*' AND company.stockcode = orders.stockcode and portfolio.stockcode = orders.stockcode --> this is working

into:

rs = datasourcedb.query("SELECT orders.stockcode,datetime,orderqty,price,ordertype,ordid,ordertotal FROM orders,company,portfolio WHERE datetime like \'%"+ orderdate + "%\' and company.stockcode = orders.stockcode and portfolio.stockcode = orders.stockcode");

the problem is actually when i try to insert "%". could anyone help me what the format for inserting %into this coding?

thanks you

virginia

[780 byte] By [j1na] at [2007-10-2 0:16:02]
# 1
You might remove the \ before the single-quote '.A better way would be to use PreparedStatement instead of bothering about escaping Strings.
Annie.a at 2007-7-15 16:17:24 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
it really work thx so much
j1na at 2007-7-15 16:17:24 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...