Package java.sql

Examples of java.sql.ResultSet.beforeFirst()


            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 Jugador;
                Boolean estado;
                for (int i=0; i<nfilas; i++){   
                    tabla.next();
                    estado = true;
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 Jugador[nfilas];
                Boolean estado;
                for (int i=0; i<nfilas; i++){   
                    tabla.next();
                    estado = true;
View Full Code Here

                /* Get some records from your database */
                Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
                ResultSet rs = stmt.executeQuery(setQuery);
                rs.last();
                int numRows = rs.getRow();
                rs.beforeFirst();
                int count;
               
//              if (debug) System.out.println("JDBCLimitedOAICatalog.listSets: numRows=" + numRows);
               
                /* load the sets ArrayLists. */
 
View Full Code Here

                /* Get some records from your database */
                Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
                ResultSet rs = stmt.executeQuery(setQuery);
                rs.last();
                int numRows = rs.getRow();
                rs.beforeFirst();
                int count;
               
//              if (debug) System.out.println("ExtendedJDBCOAICatalog.listSets: numRows=" + numRows);
               
                /* load the sets ArrayLists. */
 
View Full Code Here

            int numRows = rs.getRow();
            if (numRows == 0) {
                endConnection(con);
                throw new NoItemsMatchException();
            }
            rs.beforeFirst();
            int count;
           
            /* load the headers and identifiers ArrayLists. */
            for (count=0; count < maxListSize && rs.next(); ++count) {
                HashMap nativeItem = getColumnValues(rs);
View Full Code Here

            int numRows = rs.getRow();
            if (numRows == 0) {
                endConnection(con);
                throw new NoItemsMatchException();
            }
            rs.beforeFirst();
            int count;
           
//          if (debug) System.out.println("JDBCOAICatalog.listRecords: numRows=" + numRows);
           
            /* load the records ArrayList */
 
View Full Code Here

                /* Get some records from your database */
                Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
                ResultSet rs = stmt.executeQuery(setQuery);
                rs.last();
                int numRows = rs.getRow();
                rs.beforeFirst();
                int count;
               
//              if (debug) System.out.println("JDBCOAICatalog.listSets: numRows=" + numRows);
               
                /* load the sets ArrayLists. */
 
View Full Code Here

        context.setFirstResult((page - 1) * context.getResultsPerPage());

        outList.setAttribute("pageCount", new Integer(maxPage));
        outList.setAttribute("page", String.valueOf(page));

        set.beforeFirst();

        int num = 1;

        int offsetRecord = (page - 1) * context.getResultsPerPage();
        int recordCount = 0;
View Full Code Here

    public static List<String> getDatabaseTables(Connection conn) throws SQLException {
        List<String> tables = new ArrayList<String>();
        DatabaseMetaData dbMeta = conn.getMetaData();
        ResultSet resultSet = dbMeta.getTables(null, null, null, new String[] {"TABLE"});
        if (resultSet.getType() != ResultSet.TYPE_FORWARD_ONLY && !resultSet.isBeforeFirst()) {
            resultSet.beforeFirst();
        }
        while (resultSet.next()) {
            tables.add(resultSet.getString("TABLE_NAME").toLowerCase());
        }
        resultSet.close();
View Full Code Here

        rs.relative(1);
        rs.absolute(3);
        rs.relative(-1);
        rs.first();
        rs.last();
        rs.beforeFirst();
        rs.afterLast();
       
        // close result set and statement
        rs.close();
        s.close();
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.