Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个PreparedStatementWrapper包含INSERT语句的对象。现在我想打印我的对象。我想测试我的INSERT陈述,看看它是否正确。我怎样才能做到这一点?
PreparedStatementWrapper
INSERT
只需在执行之前使用System.out.println()and方法。toString()
System.out.println()
toString()
PreparedStatement ps = con.prepareStatement(QUERY); ps.setString(1, "Test"); System.out.println(ps.toString());
编辑:它仅在您使用MYSQL驱动程序时才有效。
MYSQL