import java.sql.*; public class SimpleDeadLockDemo { public static void main(String args[]) throws Exception { Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5830/jurka?loglevel=2", "jurka", ""); Statement stmt = conn.createStatement(); stmt.execute("CREATE TEMP TABLE dltable (a int)"); PreparedStatement pstmt = conn.prepareStatement("INSERT INTO dltable VALUES (?)"); for (int i=0; i<6; i++) { if (i % 2 == 0) { pstmt.setInt(1, 1); } else { pstmt.setObject(1, new Integer(1), Types.OTHER); } pstmt.addBatch(); } pstmt.executeBatch(); conn.close(); } }