云数据库 GAUSSDB-使用JDBC操作密态数据库:执行加密表的预编译SQL语句

时间:2024-05-20 08:54:37

执行加密表的预编译SQL语句

// 调用Connection的prepareStatement方法创建预编译语句对象。
PreparedStatement pstmt = con.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-cent/gaussdb-48-0014.html