import java.sql.*; public class helloP { public static void main(String args[]) { try { Class.forName("org.postgresql.Driver"); Connection connection = DriverManager.getConnection( "jdbc:postgresql://sql.csic.cs.umd.edu/user", "user", "pass"); Statement statement = connection.createStatement(); statement.executeUpdate( "CREATE TABLE hello (value varchar(50))"); statement.executeUpdate( "INSERT INTO hello VALUES('Hello world!')"); ResultSet resultset = statement.executeQuery( "SELECT * FROM hello " + "WHERE UPPER('foo-bar') LIKE UPPER('FoO-BaR')"); if (resultset != null) // this should not be null.. while(resultset.next()) { System.out.println( resultset.getString(1)); } resultset.close(); statement.close(); connection.close(); } catch(Exception exc) { exc.printStackTrace(); } } }