{"id":1831,"date":"2022-11-27T23:22:20","date_gmt":"2022-11-27T15:22:20","guid":{"rendered":"https:\/\/qaqaq.top\/?p=1831"},"modified":"2022-11-28T21:31:56","modified_gmt":"2022-11-28T13:31:56","slug":"%e6%95%b0%e6%8d%ae%e5%ba%93%e4%ba%8b%e5%8a%a1%e7%9a%84%e9%97%ae%e9%a2%98%e5%bc%95%e5%85%a5%e3%80%81%e4%bd%95%e4%b8%ba%e4%ba%8b%e5%8a%a1%e5%8f%8a%e6%95%b0%e6%8d%ae%e5%ba%93%e4%ba%8b%e5%8a%a1%e7%9a%84","status":"publish","type":"post","link":"https:\/\/qaqaq.top\/?p=1831","title":{"rendered":"\u6570\u636e\u5e93\u4e8b\u52a1\u7684\u95ee\u9898\u5f15\u5165\u3001\u4f55\u4e3a\u4e8b\u52a1\u53ca\u6570\u636e\u5e93\u4e8b\u52a1\u7684\u5904\u7406\u539f\u5219\u3001\u8003\u8651\u4e8b\u52a1\u4ee5\u540e\u7684\u4ee3\u7801\u5b9e\u73b0\u3001\u8bbe\u7f6e\u8fde\u63a5\u6062\u590d\u4e3a\u9ed8\u8ba4\u72b6\u6001\u3001Java\u4ee3\u7801\u6f14\u793a\u5e76\u8bbe\u7f6e\u6570\u636e\u5e93\u7684\u9694\u79bb\u7ea7\u522b"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>package top.qaqaq.P35.util.transaction;\r\n\r\nimport java.lang.reflect.Field;\r\nimport java.sql.Connection;\r\nimport java.sql.PreparedStatement;\r\nimport java.sql.ResultSet;\r\nimport java.sql.ResultSetMetaData;\r\nimport java.sql.SQLException;\r\n\r\nimport org.junit.Test;\r\n\r\nimport top.qaqaq.P14.util.JDBCUtils;\r\n\r\n\/*\r\n * 1.\u4ec0\u4e48\u53eb\u6570\u636e\u5e93\u4e8b\u52a1\uff1f\r\n * \u4e8b\u52a1\uff1a\u4e00\u7ec4\u903b\u8f91\u64cd\u4f5c\u5355\u5143\uff0c\u4f7f\u6570\u636e\u4ece\u4e00\u79cd\u72b6\u6001\u53d8\u6362\u5230\u53e6\u4e00\u79cd\u72b6\u6001\u3002\r\n * \t\t> \u4e00\u7ec4\u903b\u8f91\u64cd\u4f5c\u5355\u5143\uff1a\u4e00\u4e2a\u6216\u591a\u4e2aDML\u64cd\u4f5c\u3002\r\n * \r\n * 2.\u4e8b\u52a1\u5904\u7406\u7684\u539f\u5219\uff1a\u4fdd\u8bc1\u6240\u6709\u4e8b\u52a1\u90fd\u4f5c\u4e3a\u4e00\u4e2a\u5de5\u4f5c\u5355\u5143\u6765\u6267\u884c\uff0c\u5373\u4f7f\u51fa\u73b0\u4e86\u6545\u969c\uff0c\u90fd\u4e0d\u80fd\u6539\u53d8\u8fd9\u79cd\u6267\u884c\u65b9\u5f0f\u3002\r\n * \u5f53\u5728\u4e00\u4e2a\u4e8b\u52a1\u4e2d\u6267\u884c\u591a\u4e2a\u64cd\u4f5c\u65f6\uff0c\u8981\u4e48\u6240\u6709\u7684\u4e8b\u52a1\u90fd\u88ab\u63d0\u4ea4(commit)\uff0c\u90a3\u4e48\u8fd9\u4e9b\u4fee\u6539\u5c31\u6c38\u4e45\u5730\u4fdd\u5b58\u4e0b\u6765\uff1b\r\n * \u8981\u4e48\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u5c06\u653e\u5f03\u6240\u4f5c\u7684\u6240\u6709\u4fee\u6539\uff0c\u6574\u4e2a\u4e8b\u52a1\u56de\u6eda(rollback)\u5230\u6700\u521d\u72b6\u6001\u3002\r\n * \r\n * 3.\u6570\u636e\u4e00\u65e6\u63d0\u4ea4\uff0c\u5c31\u4e0d\u53ef\u56de\u6eda\r\n * \r\n * 4.\u54ea\u4e9b\u64cd\u4f5c\u4f1a\u5bfc\u81f4\u6570\u636e\u7684\u81ea\u52a8\u63d0\u4ea4\uff1f\r\n * \t\t> DDL\u64cd\u4f5c\u4e00\u65e6\u6267\u884c\uff0c\u90fd\u4f1a\u81ea\u52a8\u63d0\u4ea4\r\n * \t\t\t>set autocommit = false\t\u5bf9DDL\u64cd\u4f5c\u5931\u6548\r\n * \t\t> DML\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4e00\u65e6\u6267\u884c\uff0c\u5c31\u4f1a\u81ea\u52a8\u63d0\u4ea4\u3002\r\n * \t\t\t>\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7set autocommit = false\u7684\u65b9\u5f0f\u53d6\u6d88DML\u64cd\u4f5c\u7684\u81ea\u52a8\u63d0\u4ea4\u3002\r\n * \t\t\t>\u9ed8\u8ba4\u5728\u5173\u95ed\u8fde\u63a5\u65f6\uff0c\u4f1a\u81ea\u52a8\u7684\u63d0\u4ea4\u6570\u636e(\u5f53\u8bbe\u7f6eset autocommit = false\u65f6 \u5173\u95ed\u8fde\u63a5\u81ea\u52a8\u63d0\u4ea4\u5931\u6548)\r\n * \r\n * \r\n *\/\r\n\r\npublic class TransactionTest {\r\n\r\n\t\/\/ *************************\u672a\u8003\u8651\u6570\u636e\u5e93\u4e8b\u52a1\u60c5\u51b5\u4e0b\u7684\u8f6c\u8d26\u64cd\u4f5c*******************************\r\n\t\/*\r\n\t * \u9488\u5bf9\u4e8e\u6570\u636e\u8868user_table\u6765\u8bf4\uff1a AA\u7528\u6237\u7ed9BB\u7528\u6237\u8f6c\u8d26100\r\n\t * \r\n\t * update user_table set balance = balance - 100 where user = 'AA'; update\r\n\t * user_table set balance = balance + 100 where user = 'BB';\r\n\t *\/\r\n\t@Test\r\n\tpublic void testUpdate() {\r\n\r\n\t\tString sql1 = \"update user_table set balance = balance - 100 where user = ?\";\r\n\t\tupdate(sql1, \"AA\");\r\n\r\n\t\t\/\/ \u6a21\u62df\u7f51\u7edc\u5f02\u5e38\r\n\t\tSystem.out.println(10 \/ 0);\r\n\r\n\t\tString sql2 = \"update user_table set balance = balance + 100 where user = ?\";\r\n\t\tupdate(sql2, \"BB\");\r\n\r\n\t\tSystem.out.println(\"\u8f6c\u8d26\u6210\u529f\");\r\n\t}\r\n\r\n\t\/\/ \u901a\u7528\u7684\u589e\u5220\u6539\u64cd\u4f5c --version 1.0\r\n\tpublic int update(String sql, Object... args) {\/\/ sql\u4e2d\u5360\u4f4d\u7b26\u7684\u4e2a\u6570\u4e0e\u53ef\u53d8\u5f62\u53c2\u7684\u957f\u5ea6\u76f8\u540c\uff01\r\n\t\tConnection conn = null;\r\n\t\tPreparedStatement ps = null;\r\n\t\ttry {\r\n\t\t\t\/\/ 1.\u83b7\u53d6\u6570\u636e\u5e93\u7684\u8fde\u63a5\r\n\t\t\tconn = JDBCUtils.getConnection();\r\n\t\t\t\/\/ 2.\u9884\u7f16\u8bd1sql\u8bed\u53e5\uff0c\u8fd4\u56dePreparedStatement\u5b9e\u4f8b\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\t\/\/ 3.\u586b\u5145\u5360\u4f4d\u7b26\r\n\t\t\tfor (int i = 0; i &lt; args.length; i++) {\r\n\t\t\t\tps.setObject(i + 1, args&#91;i]);\/\/ \u5c0f\u5fc3\u53c2\u6570\u58f0\u660e\u9519\u8bef\uff01\uff01\r\n\t\t\t}\r\n\t\t\t\/\/ 4.\u6267\u884c\r\n\t\t\treturn ps.executeUpdate();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t\/\/ 5.\u8d44\u6e90\u7684\u5173\u95ed\r\n\t\t\tJDBCUtils.closeResource(conn, ps);\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t\/\/ ************************\u8003\u8651\u6570\u636e\u5e93\u4e8b\u52a1\u540e\u7684\u8f6c\u8d26\u64cd\u4f5c**************************************\r\n\r\n\t@Test\r\n\tpublic void testUpdateWithTx() {\r\n\t\tConnection conn = null;\r\n\t\ttry {\r\n\t\t\tconn = JDBCUtils.getConnection();\r\n\t\t\tSystem.out.println(conn.getAutoCommit());\r\n\r\n\t\t\t\/\/ 1.\u53d6\u6d88\u6570\u636e\u7684\u81ea\u52a8\u63d0\u4ea4\r\n\t\t\tconn.setAutoCommit(false);\r\n\r\n\t\t\tString sql1 = \"update user_table set balance = balance - 100 where user = ?\";\r\n\t\t\tupdate(conn, sql1, \"AA\");\r\n\r\n\t\t\t\/\/ \u6a21\u62df\u7f51\u7edc\u5f02\u5e38\r\n\t\t\tSystem.out.println(10 \/ 0);\r\n\r\n\t\t\tString sql2 = \"update user_table set balance = balance + 100 where user = ?\";\r\n\t\t\tupdate(conn, sql2, \"BB\");\r\n\r\n\t\t\tSystem.out.println(\"\u8f6c\u8d26\u6210\u529f\");\r\n\r\n\t\t\t\/\/ 2.\u63d0\u4ea4\u6570\u636e\r\n\t\t\tconn.commit();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t\/\/ 3.\u56de\u6eda\u6570\u636e\r\n\t\t\ttry {\r\n\t\t\t\tconn.rollback();\r\n\t\t\t} catch (SQLException e1) {\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tJDBCUtils.closeResource(conn, null);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t\/\/ \u901a\u7528\u7684\u589e\u5220\u6539\u64cd\u4f5c --version 2.0 (\u8003\u8651\u4e0a\u4e8b\u52a1)\r\n\tpublic int update(Connection conn, String sql, Object... args) {\/\/ sql\u4e2d\u5360\u4f4d\u7b26\u7684\u4e2a\u6570\u4e0e\u53ef\u53d8\u5f62\u53c2\u7684\u957f\u5ea6\u76f8\u540c\uff01\r\n\t\tPreparedStatement ps = null;\r\n\t\ttry {\r\n\t\t\t\/\/ 1.\u9884\u7f16\u8bd1sql\u8bed\u53e5\uff0c\u8fd4\u56dePreparedStatement\u5b9e\u4f8b\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\t\/\/ 2.\u586b\u5145\u5360\u4f4d\u7b26\r\n\t\t\tfor (int i = 0; i &lt; args.length; i++) {\r\n\t\t\t\tps.setObject(i + 1, args&#91;i]);\/\/ \u5c0f\u5fc3\u53c2\u6570\u58f0\u660e\u9519\u8bef\uff01\uff01\r\n\t\t\t}\r\n\t\t\t\/\/ 3.\u6267\u884c\r\n\t\t\treturn ps.executeUpdate();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\r\n\t\t\t\/\/ \u4fee\u6539\u5176\u4e3a\u81ea\u52a8\u63d0\u4ea4\u6570\u636e\r\n\t\t\t\/\/ \u4e3b\u8981\u9488\u5bf9\u4e8e\u4f7f\u7528\u6570\u636e\u5e93\u8fde\u63a5\u6c60\u7684\u4f7f\u7528\r\n\/\/\t\t\ttry {\r\n\/\/\t\t\t\tconn.setAutoCommit(true);\r\n\/\/\t\t\t} catch (SQLException e) {\r\n\/\/\t\t\t\te.printStackTrace();\r\n\/\/\t\t\t}\r\n\r\n\t\t\t\/\/ 4.\u8d44\u6e90\u7684\u5173\u95ed\r\n\t\t\tJDBCUtils.closeResource(null, ps);\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}\r\n\r\n\t\/\/ ********************************************************************************\r\n\t@Test\r\n\tpublic void testTransactionSelect() throws Exception {\r\n\r\n\t\tConnection conn = JDBCUtils.getConnection();\r\n\t\t\/\/\u83b7\u53d6\u5f53\u524d\u8fde\u63a5\u7684\u9694\u79bb\u7ea7\u522b\r\n\t\tSystem.out.println(conn.getTransactionIsolation());\r\n\t\t\/\/\u8bbe\u7f6e\u6570\u636e\u5e93\u7684\u9694\u79bb\u7ea7\u522b\uff1a\r\n\t\tconn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);\r\n\t\t\r\n\t\t\/\/\u53d6\u6d88\u81ea\u52a8\u63d0\u4ea4\r\n\t\tconn.setAutoCommit(false);\r\n\t\t\r\n\t\tString sql = \"select user,password,balance from user_table where user = ?\";\r\n\t\tUser user = getInstance(conn, User.class, sql, \"CC\");\r\n\t\t\r\n\t\tSystem.out.println(user);\r\n\t\t\r\n\t}\r\n\r\n\t@Test\r\n\tpublic void testTransactionUpdate() throws Exception {\r\n\t\tConnection conn = JDBCUtils.getConnection();\r\n\t\t\r\n\t\t\/\/\u53d6\u6d88\u81ea\u52a8\u63d0\u4ea4\r\n\t\tconn.setAutoCommit(false);\r\n\t\t\r\n\t\tString sql = \"update user_table set balance = ? where user = ?\";\r\n\t\tupdate(conn, sql, 5000, \"CC\");\r\n\t\t\r\n\t\tThread.sleep(15000);\r\n\t\t\r\n\t\tSystem.out.println(\"\u4fee\u6539\u7ed3\u675f\");\r\n\t\t\r\n\r\n\t}\r\n\r\n\t\/\/ \u901a\u7528\u7684\u67e5\u8be2\u64cd\u4f5c\uff0c\u7528\u4e8e\u8fd4\u56de\u6570\u636e\u8868\u4e2d\u7684\u4e00\u6761\u8bb0\u5f55(varsion 2.0,\u8003\u8651\u4e0a\u4e8b\u52a1)\r\n\tpublic &lt;T> T getInstance(Connection conn, Class&lt;T> clazz, String sql, Object... args) {\r\n\t\tPreparedStatement ps = null;\r\n\t\tResultSet rs = null;\r\n\t\ttry {\r\n\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\tfor (int i = 0; i &lt; args.length; i++) {\r\n\t\t\t\tps.setObject(i + 1, args&#91;i]);\r\n\t\t\t}\r\n\r\n\t\t\trs = ps.executeQuery();\r\n\t\t\t\/\/ \u83b7\u53d6\u7ed3\u679c\u96c6\u7684\u5143\u6570\u636e : ResultSetMetaData\r\n\t\t\tResultSetMetaData rsmd = rs.getMetaData();\r\n\t\t\t\/\/ \u901a\u8fc7ResultSetMetaData\u83b7\u53d6\u7ed3\u679c\u96c6\u4e2d\u7684\u5217\u6570\r\n\t\t\tint columnCount = rsmd.getColumnCount();\r\n\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\tT t = clazz.newInstance();\r\n\t\t\t\t\/\/ \u5904\u7406\u7ed3\u679c\u96c6\u4e00\u884c\u6570\u636e\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5217\r\n\t\t\t\tfor (int i = 0; i &lt; columnCount; i++) {\r\n\t\t\t\t\t\/\/ \u83b7\u53d6\u5217\u503c\r\n\t\t\t\t\tObject columnvalue = rs.getObject(i + 1);\r\n\r\n\t\t\t\t\t\/\/ \u83b7\u53d6\u6bcf\u4e2a\u5217\u7684\u5217\u540d\r\n\/\/\t\t\t\t\tString columnName = rsmd.getColumnName(i + 1);\r\n\t\t\t\t\tString columnLabel = rsmd.getColumnLabel(i + 1);\r\n\r\n\t\t\t\t\t\/\/ \u7ed9t\u5bf9\u8c61\u6307\u5b9a\u7684columnName\u5c5e\u6027\uff0c\u8d4b\u503c\u4e3acolumnvalue\uff1b\u901a\u8fc7\u53cd\u5c04\r\n\t\t\t\t\tField field = clazz.getDeclaredField(columnLabel);\r\n\t\t\t\t\tfield.setAccessible(true);\r\n\t\t\t\t\tfield.set(t, columnvalue);\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn t;\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\/\/\t\t\tJDBCUtils.closeResource(null, ps, rs);\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}\r\n}\r\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>package top.qaqaq.P35.util.transaction;\r\n\r\npublic class User {\r\n\r\n\tprivate String user;\r\n\tprivate String password;\r\n\tprivate int balance;\r\n\r\n\tpublic User() {\r\n\t}\r\n\r\n\tpublic User(String user, String password, int balance) {\r\n\t\tthis.user = user;\r\n\t\tthis.password = password;\r\n\t\tthis.balance = balance;\r\n\t}\r\n\r\n\tpublic String getUser() {\r\n\t\treturn user;\r\n\t}\r\n\r\n\tpublic void setUser(String user) {\r\n\t\tthis.user = user;\r\n\t}\r\n\r\n\tpublic String getPassword() {\r\n\t\treturn password;\r\n\t}\r\n\r\n\tpublic void setPassword(String password) {\r\n\t\tthis.password = password;\r\n\t}\r\n\r\n\tpublic int getBalance() {\r\n\t\treturn balance;\r\n\t}\r\n\r\n\tpublic void setBalance(int balance) {\r\n\t\tthis.balance = balance;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic String toString() {\r\n\t\treturn \"User &#91;user=\" + user + \", password=\" + password + \", balance=\" + balance + \"]\";\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>package top.qaqaq.P35.util.transaction;\n\nimport java.sql.Connection;\n\nimport org.junit.Test;\n\nimport top.qaqaq.P14.util.JDBCUtils;\n\npublic class ConnectionTest {\n\t\n\t@Test\n\tpublic void testGetConnection() throws Exception {\n\t\tConnection conn = JDBCUtils.getConnection();\n\t\tSystem.out.println(conn);\n\t\t\n\t\t\n\t}\n\n}\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>package top.qaqaq.P35.util;\r\n\r\nimport java.io.InputStream;\r\nimport java.sql.Connection;\r\nimport java.sql.DriverManager;\r\nimport java.sql.ResultSet;\r\nimport java.sql.SQLException;\r\nimport java.sql.Statement;\r\nimport java.util.Properties;\r\n\r\n\/**\r\n * \r\n * @Description \u64cd\u4f5c\u6570\u636e\u5e93\u7684\u5de5\u5177\u7c7b\r\n * @author RichieZhang Email:18358892@qq.com\r\n * @version\r\n * @date 2022\u5e7411\u670826\u65e5\u4e0b\u53483:57:13\r\n *\r\n *\/\r\npublic class JDBCUtils {\r\n\r\n\t\/**\r\n\t * \r\n\t * @Description \u83b7\u53d6\u6570\u636e\u5e93\u7684\u8fde\u63a5\r\n\t * @author RichieZhang\r\n\t * @date 2022\u5e7411\u670826\u65e5\u4e0b\u53484:00:53\r\n\t * @return\r\n\t * @throws Exception\r\n\t *\/\r\n\tpublic static Connection getConnection() throws Exception {\r\n\t\t\/\/ 1.\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\u4e2d\u76844\u4e2a\u57fa\u672c\u4fe1\u606f\r\n\t\tInputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream(\"jdbc.properties\");\r\n\r\n\t\tProperties pros = new Properties();\r\n\t\tpros.load(is);\r\n\r\n\t\tString user = pros.getProperty(\"user\");\r\n\t\tString password = pros.getProperty(\"password\");\r\n\t\tString url = pros.getProperty(\"url\");\r\n\t\tString driverClass = pros.getProperty(\"driverClass\");\r\n\r\n\t\t\/\/ 2.\u52a0\u8f7d\u9a71\u52a8\r\n\t\tClass.forName(driverClass);\r\n\r\n\t\t\/\/ 3.\u83b7\u53d6\u8fde\u63a5\r\n\t\tConnection conn = DriverManager.getConnection(url, user, password);\r\n\t\treturn conn;\r\n\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t * @Description \u5173\u95ed\u8fde\u63a5\u548cStatement\u7684\u64cd\u4f5c\r\n\t * @author RichieZhang\r\n\t * @date 2022\u5e7411\u670826\u65e5\u4e0b\u53484:04:17\r\n\t * @param conn\r\n\t * @param ps\r\n\t *\/\r\n\tpublic static void closeResource(Connection conn, Statement ps) {\r\n\t\ttry {\r\n\t\t\tif (ps != null)\r\n\t\t\t\t\tps.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (conn != null)\r\n\t\t\t\t\tconn.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t\/**\r\n\t * \r\n\t* @Description \t\u5173\u95ed\u8d44\u6e90\u64cd\u4f5c\r\n\t* @author RichieZhang\r\n\t* @date 2022\u5e7411\u670826\u65e5\u4e0b\u53485:29:47\r\n\t* @param conn\r\n\t* @param ps\r\n\t* @param rs\r\n\t *\/\r\n\tpublic static void closeResource(Connection conn, Statement ps, ResultSet rs) {\r\n\t\ttry {\r\n\t\t\tif (ps != null)\r\n\t\t\t\t\tps.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (conn != null)\r\n\t\t\t\t\tconn.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (rs != null)\r\n\t\t\t\t\trs.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}\r\n}\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[48],"class_list":["post-1831","post","type-post","status-publish","format-standard","hentry","category-jdbc-code","tag-jdbc"],"_links":{"self":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/1831"}],"collection":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1831"}],"version-history":[{"count":2,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/1831\/revisions"}],"predecessor-version":[{"id":1862,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/1831\/revisions\/1862"}],"wp:attachment":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}