import java.sql.*; public class Test { public static void main(String argv[]) { try { Connection mysql = MySQLConnection.getConnection(); final String insert = "insert into test(a) value(?)"; PreparedStatement insertStatement = mysql.prepareStatement(insert); insertStatement.setInt(1, 3); insertStatement.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } } }