System.out.println("maxId=" + maxId);
    private String getNextId(Connection dbConnection, String queryName, MessageFormat format) {        String id = format.format(new Object[] {new Integer(1)}); // Default        try {            Statement stmt = dbConnection.createStatement();            try {                String query = dbp.getQuery(queryName, null);                ResultSet rs = executeQuery(stmt, query);                try {                    if (rs.next()) {                        String maxId = rs.getString(1);                        System.out.println("maxId=" + maxId);                        int n = ((Number) format.parse(maxId)[0]).intValue();                        id = format.format(new Object[] {new Integer(n + 1)});                    }                } finally {                    rs.close();                }            } finally {                stmt.close();            }        } catch (Exception e) {            System.out.println("Using default id: " + id);            // Ignore exceptions and use default        }        return id;    }