Package java.sql

Examples of java.sql.ResultSet.beforeFirst()


      int numRows = 0;
      if (rs.next()) {
        rs.last();
        numRows = rs.getRow();
      }
      rs.beforeFirst();
      //print out the rows
      int rowCountShowProgress = 0;
      int rowNum = 0;
      while (rs.next()) {
        rowNum++;
View Full Code Here


          "SELECT CompId,APP.Account.Account,AccDesc,IsAsset FROM APP.Account"));
      int numRows = 0;
      if (rsAccounts.next()) {
        rsAccounts.last();
        numRows = rsAccounts.getRow();
        rsAccounts.beforeFirst();
      }
      if (numRows > 0) {
        int ACCOUNT_TYPE_ASSET = 0;
        int ACCOUNT_TYPE_DEBT = 1;
        int ACCOUNT_TYPE_INCOME = 2;
View Full Code Here

        if ((numEuBasErrors * 100 / numRows) > 10) {
          //more then 10% errors
          isEuBasAccounting = false;
        }
        //attempt to see if this is a EU BAS 2000 account. system
        rsAccounts.beforeFirst();
        while (rsAccounts.next()) {
          //sum up account
          workDialog.SetProgress(100 * rsAccounts.getRow() / numRows);
          int oldIsAsset = rsAccounts.getInt(4);
          int defaultIsAsset = 0;
View Full Code Here

          Statement st = dc.con.createStatement();
          ResultSet rsOldTrans = st.executeQuery(dc.filterSQL(
              "SELECT CompId,Act_id,RegDate,InvDate,Notes,FileInfo FROM Activity ORDER BY CompId,Act_id"));
          rsOldTrans.last();
          int numRecs=rsOldTrans.getRow();
          rsOldTrans.beforeFirst();
          while (rsOldTrans.next()) {
            PreparedStatement prepSt = dc.con.prepareStatement(
              "INSERT INTO Activity2 (CompId,Act_id,PeriodId,RegDate,InvDate,Notes,FileInfo) VALUES (?,?,?,?,?,?,?)");
            prepSt.setInt(1,rsOldTrans.getInt(1));
            prepSt.setInt(2, rsOldTrans.getInt(2));
View Full Code Here

      select+=" ORDER BY CompId,Act_id";
      ResultSet rsOldTrans = dc.con.createStatement().executeQuery(dc.filterSQL(select));
      int lastCompId=-1;
      rsOldTrans.last();
      int numRecs=rsOldTrans.getRow();
      rsOldTrans.beforeFirst();
      while (rsOldTrans.next()) {
        if (lastCompId!=rsOldTrans.getInt(1)){
          //get all the periods for the CompId
          lastCompId=rsOldTrans.getInt(1);
          rsPeriods=dc.con.createStatement().executeQuery(dc.filterSQL(
View Full Code Here

                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

            s.executeQuery("select * from t1");
       
        rs.last();
        lastRow = rs.getRow();
       
        rs.beforeFirst();
       
        rs.next();
       
        // Test that it is possible to move to next row from insertRow
        currentPosition = rs.getRow();
View Full Code Here

        // Test that it is possible to move beforeFirst from insertRow
        currentPosition = rs.getRow();
        rs.moveToInsertRow();
        rs.updateInt(1, currentPosition + 1000);
        rs.beforeFirst();
        assertTrue("isBeforeFirst() should return true", rs.isBeforeFirst());
        rs.next();
        assertEquals("CurrentPosition should be 1", rs.getRow(), 1);
        assertTrue("isFirst() should return true", rs.isFirst());
View Full Code Here

        rs.next();
        rs.moveToInsertRow();
        checkDetectabilityCallsOutsideRow(rs, "on insertRow");
        rs.moveToCurrentRow(); // needed until to DERBY-1322 is fixed

        rs.beforeFirst();
        checkDetectabilityCallsOutsideRow(rs, "on beforeFirst row");

        rs.afterLast();
        checkDetectabilityCallsOutsideRow(rs, "on afterLast row");
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.