0

for example

  public void invoke(String value, SinkFunction.Context context) throws SQLException {
    statement_.execute("INSERT INTO test (column_1) VALUES '"+value"');
  }

how to rightly insert value?

stackover
  • 15
  • 4

1 Answers1

0

After you have got the connection you do this:

String sql = "INSERT INTO test (column_1) VALUES (?)";
PreparedStatement statement = connection.prepareStatement(sql);
        
statement.setString(1, value);
statement.addBatch();
statement.executeBatch();
Paulus
  • 162
  • 7