JAVA连oracle问题
public void mistinessfind(String ziduan){String sql = "select * from booksystem where name like '%?%'";
try {
pstat=conn.prepareStatement(sql);
pstat.setString(1,ziduan);
rs=pstat.executeQuery();
if(rs.next()){
System.out.println("打印有此书");
}
else{
System.out.println("无此书");
}
} catch (SQLException e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
}
我通过sql语句实现对数据库的模糊查找,sql语句在oracle中显示的是对的,但放在JAVA里就出问题了.请教中!~