日期:2014-05-17  浏览次数:20585 次

新手求解!!!!!!!!!!
String sql="select a_id,commodityname,commoditycount,transactionmoney,ispaid,provider,description,accountdate from user_account";
if(!Utils.isNull(productName)&&!Utils.isNull(payStatus)) {
sql =sql +" where commodityname="+productName+"and ispaid="+payStatus;
}


java.sql.SQLException: ORA-00933: SQL 命令未正确结束 这么回事???????

------解决方案--------------------
String sql="select
a_id,commodityname,commoditycount,transactionmoney,ispaid,provider,description,accoun"+"tdate from user_account";

换行的话 用“+”号连起来

------解决方案--------------------
//sql +" where commodityname="+productName+"and ispaid="+payStatus+"";这一句有问题
应该是sql +" where commodityname="+productName+" and ispaid="+payStatus+"";
也就是在and那里 少了个空格