import java.sql.*; public class ParamTypeProb { public static void main(String args[]) throws Exception { Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5820/jurka?loglevel=2&prepareThreshold=1", "jurka",""); Statement stmt = conn.createStatement(); stmt.execute("CREATE TEMP TABLE tt (a text, b date)"); stmt.close(); PreparedStatement ps = conn.prepareStatement("INSERT INTO tt VALUES (?, ?)"); ps.setString(1, "a"); ps.setDate(2, new Date(0)); ps.addBatch(); ps.setClob(1, null); ps.setNull(2, Types.DATE); ps.addBatch(); ps.executeBatch(); ps.setString(1, "b"); ps.setDate(2, new Date(0)); ps.executeUpdate(); ps.close(); conn.close(); } }