Package java.sql

Examples of java.sql.ResultSet.first()


      out.print(_$6092);
      boolean flag3 = UserModel.isAdminLoginned(request);
      boolean flag4 = UserModel.isSourceBrowser(request);
      boolean flag5 = k == 0;
      boolean flag6 = k != 0;
      if (flag5 && resultset1.first() || !flag5 && resultset1.last())
        do
        {
          i = resultset1.getInt("solution_id");
          if (i > k1)
            k1 = i;
View Full Code Here


      {
        Connection localConnection = DBConfig.getConn();
        PreparedStatement localPreparedStatement = localConnection.prepareStatement("SELECT * FROM users WHERE UPPER(user_id) = UPPER(?)");
        localPreparedStatement.setString(1, str1);
        ResultSet localResultSet = localPreparedStatement.executeQuery();
        if (localResultSet.first())
        {
          ErrorProcess.Error("The ID( " + str1 + ") existed", localPrintWriter);
          localPreparedStatement.close();
          localConnection.close();
          return;
View Full Code Here

            if (getLogger().isDebugEnabled()) getLogger().debug("executing [" + String.valueOf(query) + "]");

            ResultSet rs = preparedStatement.executeQuery(countQuery);
            try {
                if (rs.first()) {
                    rowCount = rs.getInt(1);
                    if (getLogger().isDebugEnabled()) getLogger().debug("count = " + rowCount);
                }
            }
            finally {
View Full Code Here

            println("T3: commit");
        } catch (SQLException e) {
            con2.rollback();
            throw e;
        }
        rs.first(); // Go to first tuple
        println("T1: Read first Tuple:(" + rs.getInt(1) + "," +
                rs.getInt(2) + "," +
                rs.getInt(3) + ")");
        rs.updateInt(2, 3);
        println("T1: updateInt(2, 3);");
View Full Code Here

            assertTrue("Expected T3 to hang waiting for Table lock", false);
        } catch (SQLException e) {           
            println("T3: got expected exception");
            con2.rollback();           
        }
        rs.first(); // Go to first tuple
        println("T1: Read first Tuple:(" + rs.getInt(1) + "," +
                rs.getInt(2) + "," +
                rs.getInt(3) + ")");
        rs.updateInt(2, 3);
        println("T1: updateInt(2, 3);");
View Full Code Here

    } else {
      Statement idStatement = connection.createStatement();
      idStatement.setMaxRows(1);

      ResultSet rs = idStatement.executeQuery(sqlDialect.getSelectInsertId());
      rs.first();
      eventIDArray[0] = rs.getInt(1);
    }
  }

  void insertProperties(
View Full Code Here

    }

    // Verify that first() doesn't work
    try
    {
      rs.first();
      // Should never get here
      System.out.println("first() expected to fail");
      passed = false;
    }
    catch (SQLException sqle)
View Full Code Here

    {
      System.out.println("still expected to be before the 1st row");
      passed = false;
    }
    // go to first row
    if (! rs.first())
    {
      System.out.println("expected first() to succeed");
      passed = false;
    }
    if (rs.getInt(1) != 2)
View Full Code Here

                                (maxRows + 1) + "th row.");
                        passed = false;
                }

                // Start from first and verify maxRows
                if (!rs.first())
                {
                        System.out.println("rs.first() failed.");
                        passed = false;
                }
                // Iterate forward thru RS, expect only (maxRows - 1) more rows.
View Full Code Here

    }

    // Verify that first(), etc. don't work
    try
    {
      rs.first();
      // Should never get here
      System.out.println("first() expected to fail");
      passed = false;
    }
    catch (SQLException sqle)
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.