statement.execute("INSERT INTO deftab (name ) VALUE (txtName.getText().toString)");
....
private static final String INSERT = "INSERT INTO deftab (name ) VALUE (?)";
....
public void insert(String name) {
try (Connection connection = DBConnectionPool.getConnection();
PreparedStatement ps = connection.prepareStatement(INSERT_NEWS)) {
ps.setString(1, name);
ps.execute();
} catch (SQLException e) {
e.printStackTrace();
}
}