@Override public void dropReplicationSlot(String slotName) throws SQLException { if (slotName == null || slotName.isEmpty()) { throw new IllegalArgumentException("Replication slot name can't be null or empty"); } Statement statement = connection.createStatement(); try { statement.execute("DROP_REPLICATION_SLOT " + slotName); } finally { statement.close(); } } }
@Override public void make() throws SQLException { if (slotName == null || slotName.isEmpty()) { throw new IllegalArgumentException("Replication slotName can't be null"); } Statement statement = connection.createStatement(); try { statement.execute(String.format("CREATE_REPLICATION_SLOT %s PHYSICAL", slotName)); } finally { statement.close(); } } }
@Override public void make() throws SQLException { if (outputPlugin == null || outputPlugin.isEmpty()) { throw new IllegalArgumentException( "OutputPlugin required parameter for logical replication slot"); } if (slotName == null || slotName.isEmpty()) { throw new IllegalArgumentException("Replication slotName can't be null"); } Statement statement = connection.createStatement(); try { statement.execute(String.format("CREATE_REPLICATION_SLOT %s LOGICAL %s", slotName, outputPlugin)); } finally { statement.close(); } } }
} else { try { Statement stmt = conn.createStatement(); try {
Statement stmt = conn.createStatement(); try
return; Statement stmt = connection.createStatement(); ResultSet rs = stmt.executeQuery(sql.toString()); while (rs.next()) {
private ResultSet readBinaryResultSet(int index, int count) throws SQLException { int dimensions = ByteConverter.int4(fieldBytes, 0); // int flags = ByteConverter.int4(fieldBytes, 4); // bit 0: 0=no-nulls, 1=has-nulls int elementOid = ByteConverter.int4(fieldBytes, 8); int pos = 12; int[] dims = new int[dimensions]; for (int d = 0; d < dimensions; ++d) { dims[d] = ByteConverter.int4(fieldBytes, pos); pos += 4; /* int lbound = ByteConverter.int4(fieldBytes, pos); */ pos += 4; } if (count > 0 && dimensions > 0) { dims[0] = Math.min(count, dims[0]); } List<byte[][]> rows = new ArrayList<byte[][]>(); Field[] fields = new Field[2]; storeValues(rows, fields, elementOid, dims, pos, 0, index); BaseStatement stat = (BaseStatement) connection .createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); return stat.createDriverResultSet(fields, rows); }
Statement stmt = connection.createStatement(); ResultSet rs = null; GettableHashMap<FieldMetadata.Key, FieldMetadata> md = new GettableHashMap<FieldMetadata.Key, FieldMetadata>();
Statement stmt = conn.createStatement(); try { stmt.executeUpdate("ROLLBACK PREPARED '" + s + "'");
Statement stmt = conn.createStatement(); try { stmt.executeUpdate("COMMIT PREPARED '" + s + "'");
Statement stmt = conn.createStatement(); try
Statement stmt = conn.createStatement(); ResultSet res = stmt.executeQuery(sql);
BaseStatement stat = (BaseStatement) connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); return (ResultSet) stat.createDriverResultSet(fields, rows);
Statement stmt = conn.createStatement(); try
String s = RecoveredXid.xidToString(xid); Statement stmt = conn.createStatement(); try { stmt.executeUpdate("PREPARE TRANSACTION '" + s + "'");
ResultSet res = conn.createStatement().executeQuery(sql);
Statement stmt = conn.createStatement(); try
.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); return stat.createDriverResultSet(fields, rows);
Statement stmt = conn.createStatement(); try
Statement stmt = conn.createStatement(); try