コード例 #1
0
 private void execCallableStatement(final SqlConnection connection, final String sql)
     throws SQLException {
   final SqlCallableStatement callableStatement =
       dataBaseManager.createCallableStatement(connection, sql);
   callableStatement.init();
   callableStatement.executeUpdate();
 }
コード例 #2
0
 private void insert(final SqlConnection connection, final long key, final String libelle)
     throws SQLException {
   final String sql = "insert into movie values (?, ?)";
   try (final SqlCallableStatement callableStatement =
       dataBaseManager.createCallableStatement(connection, sql)) {
     callableStatement.registerParameter(0, DataType.Long, true);
     callableStatement.registerParameter(1, DataType.String, true);
     // -----
     callableStatement.init();
     // -----
     callableStatement.setValue(0, key);
     callableStatement.setValue(1, libelle);
     // -----
     callableStatement.executeUpdate();
   }
 }