好的,我有以下代码:
Statement statement = connection.createStatement();
boolean resultSet = statement.execute("INSERT INTO guilds(`ID`, `Prefix`, `Join`, `Leave`, `EnableRoles`, `Role`)"
+"select col1, col2, col3, col4, col5, col6"
+"from (select '"+id+"' as col1, '//' as col2, 'Welcome, {user}!' as col3, 'Goodbye, {user}!' as col4, 'false' as col5, 'none' as col6) t"
+"WHERE NOT EXISTS (SELECT * FROM guilds WHERE ID = '123');");
通常,当你执行executeQuery()时;你有一个resultSet.close();方法
我想知道是否有一个执行()(似乎没有在IDE上弹出),如果没有,是否/如何关闭它像resultSet.close();
感谢。
答案 0 :(得分:0)
关闭声明statement.close()
;
最好将所有内容放在try
catch
块中并在finally
子句中执行结束。