private synchronized void update(String query) throws SQLException {
  Statement st=connection.createStatement();
  int ok=st.executeUpdate(query);
  if (ok == -1) {
    throw new SQLException("DB problem with query: " + query);
  }
  st.close();
}

private synchronized void update ( String query ) throws SQLException { Statement st = connection . createStatement ( ) ; int ok = st . executeUpdate ( query ) ; if ( ok == - 1 ) { throw new SQLException ( "DB problem with query: " + query ) ; } st . close ( ) ; }
carry out an update sql command on the database .
