如何获得PreparedStatement最终执行的sql语句
1个回答
展开全部
靠谱,推荐大家使用。�0�2�0�2Connection con = DriverManager.getConnection(url); DebugLevel debug = DebugLevel.ON; String sql = "SELECT name,rate FROM EmployeeTable WHERE rate > ?"; //Use a factory instead of Connection to get a PreparedStatement. //PreparedStatement ps = con.prepareStatement(sql); PreparedStatement ps = StatementFactory.getStatement(con,sql,debug); ps.setInt(1,25); //If ps is a DebuggableStatement, you see the statement, //otherwise, an object identifier is displayed System.out.println(" debuggable statement= " + ps.toString());�0�2�0�2附件是这段代码中用到的类。�0�2�0�2�0�2�0�2�0�2�0�2�0�2
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询