云数据库 GAUSSDB-使用JDBC操作密态数据库:执行加密表的预编译SQL语句
时间:2025-06-03 09:25:16
执行加密表的预编译SQL语句
// 调用Connection的prepareStatement方法创建预编译语句对象。 PreparedStatement pstmt = conn.prepareStatement("INSERT INTO creditcard_info VALUES (?, ?, ?);"); // 调用PreparedStatement的setShort设置参数。 pstmt.setInt(1, 2); pstmt.setString(2, "joy"); pstmt.setString(3, "6219985678349800033"); // 调用PreparedStatement的executeUpdate方法执行预编译SQL语句。 int rowcount = pstmt.executeUpdate(); // 调用PreparedStatement的close方法关闭预编译语句对象。 pstmt.close();
support.huaweicloud.com/fg-gaussdb-dist-v8/gaussdb-18-0014.html