Package java.sql

Examples of java.sql.ResultSet.beforeFirst()


            rs1.getInt(1);
            rs2.getInt(1);
        }
        rs2.close();
        // verify the temp table is not deleted yet
        rs1.beforeFirst();
        for (int i = 0; i < 20; i++) {
            rs1.next();
            rs1.getInt(1);
        }
        rs1.close();
View Full Code Here


            rs1.getInt(1);
            rs2.getInt(1);
        }
        rs2.close();
        // verify the temp table is not deleted yet
        rs1.beforeFirst();
        for (int i = 0; i < 20; i++) {
            rs1.next();
            rs1.getInt(1);
        }
        rs1.close();
View Full Code Here

        rs.updateInt(1, 10);
        rs.updateRow();
        rs.next();
        rs.updateString(2, "Welt");
        rs.updateRow();
        rs.beforeFirst();
        rs.next();
        assertEquals(10, rs.getInt(1));
        assertEquals("Hello", rs.getString(2));
        rs.next();
        assertEquals(2, rs.getInt(1));
View Full Code Here

        for (int i = 0; i < rows; i++) {
            rs.next();
            assertState(rs, rows == 0, i == 0, i == rows - 1, rows == 0 || i == rows);
        }
        try {
            rs.beforeFirst();
            assertState(rs, rows > 0, false, false, false);
        } catch (SQLException e) {
            if (!error) {
                throw e;
            }
View Full Code Here

            break;
        }
        case Value.RESULT_SET: {
            try {
                ResultSet rs = ((ValueResultSet) v).getResultSet();
                rs.beforeFirst();
                ResultSetMetaData meta = rs.getMetaData();
                int columnCount = meta.getColumnCount();
                writeInt(columnCount);
                for (int i = 0; i < columnCount; i++) {
                    writeString(meta.getColumnName(i + 1));
View Full Code Here

        }
        case Value.RESULT_SET: {
            writeByte((byte) type);
            try {
                ResultSet rs = ((ValueResultSet) v).getResultSet();
                rs.beforeFirst();
                ResultSetMetaData meta = rs.getMetaData();
                int columnCount = meta.getColumnCount();
                writeVarInt(columnCount);
                for (int i = 0; i < columnCount; i++) {
                    writeString(meta.getColumnName(i + 1));
View Full Code Here

                        Value val = DataType.readValue(null, rs, i + 1, t);
                        writeValue(val);
                    }
                }
                writeByte((byte) 0);
                rs.beforeFirst();
            } catch (SQLException e) {
                throw DbException.convert(e);
            }
            break;
        }
View Full Code Here

        }
        case Value.RESULT_SET: {
            int len = 1;
            try {
                ResultSet rs = ((ValueResultSet) v).getResultSet();
                rs.beforeFirst();
                ResultSetMetaData meta = rs.getMetaData();
                int columnCount = meta.getColumnCount();
                len += getVarIntLen(columnCount);
                for (int i = 0; i < columnCount; i++) {
                    len += getStringLen(meta.getColumnName(i + 1));
View Full Code Here

                        Value val = DataType.readValue(null, rs, i + 1, t);
                        len += getValueLen(val, handler);
                    }
                }
                len++;
                rs.beforeFirst();
            } catch (SQLException e) {
                throw DbException.convert(e);
            }
            return len;
        }
View Full Code Here

                        Value val = DataType.readValue(session, rs, i + 1, t);
                        writeValue(val);
                    }
                }
                writeBoolean(false);
                rs.beforeFirst();
            } catch (SQLException e) {
                throw DbException.convertToIOException(e);
            }
            break;
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.