Package java.sql

Examples of java.sql.ResultSet.beforeFirst()


                for(int i=1; i<=columnCount; i++) {
                    columnNames[i-1] = sqlRSMeta.getColumnName(i);
                    // initialize output
                    Vector v = new Vector();

                    sqlResult.beforeFirst();
                    while (sqlResult.next()) {
                        String value = sqlResult.getString(i);
                        v.add(value);
                        // the first time: count rows
                        if (goThroughRowsTheFirstTime)
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

        catch (SQLException e)
        {
        }
        try
        {
            rs.beforeFirst();
            fail("beforeFirst() on a TYPE_FORWARD_ONLY resultset did not throw an exception");
        }
        catch (SQLException e)
        {
        }
View Full Code Here

    public void testEmptyResult() throws SQLException
    {
        Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
        ResultSet rs = stmt.executeQuery("SELECT * FROM testrs where id=100");
        rs.beforeFirst();
        rs.afterLast();
        assertTrue(!rs.first());
        assertTrue(!rs.last());
        assertTrue(!rs.next());
    }
View Full Code Here

                    String[] modules = null;
                          
                    try {
                  rs.last();
                  modules = new String[rs.getRow()];
                  rs.beforeFirst();
                } catch (SQLException err) {
                  LogForDay.writeToLog(" " + err.getLocalizedMessage() , QCS.logPath, LogForDay.ERROR);
                }
                   
                  try {
View Full Code Here

                    String[] modules = null;
                          
                    try {
                  rs.last();
                  modules = new String[rs.getRow()];
                  rs.beforeFirst();
                } catch (SQLException err) {
                  LogForDay.writeToLog(" " + err.getLocalizedMessage() , QCS.logPath, LogForDay.ERROR);
                }
                   
                  try {
View Full Code Here

               
                while(model.getRowCount() > 0){
                  model.removeRow(0);
                }
               
                rs.beforeFirst();
               
                rowData = new Object[4];
               
                while(rs.next()){
                 
View Full Code Here

               
                while(model.getRowCount() > 0){
                  model.removeRow(0);
                }
               
                rs.beforeFirst();
               
                rowData = new Object[4];
               
                while(rs.next()){
                 
View Full Code Here

            // CARGANDO TODOS LOS METODOS
            rs = Query.executeSelect(Sentence.GET_ALL_MODULES, prop);
           
            rs.last();
            modules = new String[rs.getRow()];
            rs.beforeFirst();
           
            int cont = 0;
            while (rs.next()){
              modules[cont] = rs.getString("MODULE_NAME");
              cont++; 
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.