Package java.sql

Examples of java.sql.ResultSet.beforeFirst()


        rset.updateString(2, "insert6");
        rset.insertRow();
        rset.moveToCurrentRow();

        int index = 0;
        rset.beforeFirst();
        while (rset.next()) {
            index++;
            assertEquals(index, rset.getInt(1));
        }
        assertEquals(5, index);
View Full Code Here


        // Empty result set tests (DERBY-992)
        rs = s_i_r.executeQuery("select * from t where 1=0");
        rs.afterLast();
        assertFalse("afterLast() on empty RS should be no-op", rs.isAfterLast());
        rs.beforeFirst();
        assertFalse("beforeFirst() on empty RS should be no-op", rs
                .isBeforeFirst());

        rs.close();

View Full Code Here

        } catch (SQLException sqle) {
            assertOnlyOnScrollableException(sqle);
        }

        try {
            rs.beforeFirst();
            // Should never get here
            fail("beforeFirst() expected to fail");
        } catch (SQLException sqle) {
            assertOnlyOnScrollableException(sqle);
View Full Code Here

        assertTrue(rs.first());
        assertEquals(rs.getInt(1), 2);
        assertTrue(rs.isFirst());

        // move to before first
        rs.beforeFirst();
        assertTrue(rs.isBeforeFirst());
        // move to last row
        assertTrue(rs.last());
        assertTrue(rs.isLast());
        assertFalse(rs.isAfterLast());
View Full Code Here

                assertSQLState("XJ061",se);
            else
                assertSQLState("XJ125",se);
        }
        try {
            rs.beforeFirst();
            fail("beforeFirst() not allowed on forward only result set");
        } catch(SQLException se) {
            if (usingEmbedded())
                assertSQLState("XJ061",se);
            else
View Full Code Here

           
            rs.last();
            assertEquals("m",rs.getString(1).trim());
            assertEquals(13, rs.getInt(2));
            assertEquals(12, rs.getRow());
            rs.beforeFirst();
            assertNoCurrentRow(rs);
            assertEquals(0,rs.getRow());
            rs.next();
            assertEquals("b", rs.getString(1).trim());
            assertEquals(2, rs.getInt(2));
View Full Code Here

            {

              writeC(0xfa);
          writeH(rset.getRow());

          rset.beforeFirst();

          while (rset.next())
          {
                    int friendId = rset.getInt("friend_id");
            String friendName = rset.getString("friend_name");
View Full Code Here

            ConexionBD.getInstancia().conectar();
            ResultSet tabla = ConexionBD.getInstancia().consultar(consulta);

            if (tabla.last()) { // Si devuelve false es que la búsqueda es vacía
                int nfilas=tabla.getRow();
                tabla.beforeFirst(); // Volvemos al principio
                listajug=new Integer[nfilas];
                Boolean estado;
                for (int i=0; i<nfilas; i++){   
                    tabla.next();
                    listajug[i] = new Integer(tabla.getInt(i));
View Full Code Here

                ConexionBD.getInstancia().conectar();
                ResultSet tabla = ConexionBD.getInstancia().consultar(consulta);

                if (tabla.last()) { // Si devuelve false es que la búsqueda es vacía
                    int nfilas = tabla.getRow();
                    tabla.beforeFirst(); // Volvemos al principio
                    listajorn = new Jornada[nfilas];

                    for (int i = 0; i < nfilas; i++){   
                        tabla.next();
View Full Code Here

                
            ConexionBD.getInstancia().conectar();        // Establecemos la conexion con la Base de Datos
            ResultSet tabla = ConexionBD.getInstancia().consultar(consulta)// Ejecutamos la operacion SQL
            if(tabla.last()){
                  int numFilas = tabla.getRow();
                  tabla.beforeFirst();
                 
                 
                  for(int i=0; i<numFilas; i++){
                      tabla.next();
                     
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.