Package java.sql

Examples of java.sql.SQLWarning


    final int statementHoldabilityCheck(int resultSetHoldability)
        throws SQLException
    {
        int holdability = control.checkHoldCursors(resultSetHoldability, true);
        if (holdability != resultSetHoldability) {
            SQLWarning w =
                 SQLWarningFactory.newSQLWarning(SQLState.HOLDABLE_RESULT_SET_NOT_AVAILABLE);
           
            addWarning(w);
        }
       
View Full Code Here


    final int statementHoldabilityCheck(int resultSetHoldability)
        throws SQLException
    {
        int holdability = control.checkHoldCursors(resultSetHoldability, true);
        if (holdability != resultSetHoldability) {
            SQLWarning w =
                 EmbedSQLWarning.newEmbedSQLWarning(SQLState.HOLDABLE_RESULT_SET_NOT_AVAILABLE);
           
            addWarning(w);
        }
       
View Full Code Here

  private  static  SQLWarning  newWarningCommon( String messageId, Object[] oa )
  {
    String    message = MessageService.getCompleteMessage(messageId, oa);
    String    state = StandardException.getSQLStateFromIdentifier(messageId);
    SQLWarning  sqlw = new SQLWarning(message, state, ExceptionSeverity.WARNING_SEVERITY);

    return sqlw;
  }
View Full Code Here

    else if (stmt.resultSetConcurrency == java.sql.ResultSet.CONCUR_READ_ONLY)
      concurrencyOfThisResultSet = java.sql.ResultSet.CONCUR_READ_ONLY;
    else {
      if (!isForUpdate()) { //language resultset not updatable
        concurrencyOfThisResultSet = java.sql.ResultSet.CONCUR_READ_ONLY;
        SQLWarning w = StandardException.newWarning(SQLState.QUERY_NOT_QUALIFIED_FOR_UPDATABLE_RESULTSET);
        addWarning(w);
      } else
          concurrencyOfThisResultSet = java.sql.ResultSet.CONCUR_UPDATABLE;
    }
View Full Code Here

         * connection and we won't be able to do the close later
         */
        throw closeOnTransactionError(t);
      }
        
      SQLWarning w = theResults.getWarnings();
      if (w != null) {
        if (topWarning == null)
          topWarning = w;
        else
          topWarning.setNextWarning(w);
View Full Code Here

            }
            // Don't set any timeout when updating rows (use 0)
            // Execute the update where current of sql.
            org.apache.derby.iapi.sql.ResultSet rs =
        ps.executeSubStatement(activation, act, true, 0L);
            SQLWarning w = act.getWarnings();
            if (w != null) {
                addWarning(w);
            }
            act.close();
            //For forward only resultsets, after a update, the ResultSet will be positioned right before the next row.
View Full Code Here

                // Don't set any timeout when deleting rows (use 0)
                //execute delete where current of sql
                org.apache.derby.iapi.sql.ResultSet rs =
          ps.executeSubStatement(activation, act, true, 0L);
                SQLWarning w = act.getWarnings();
                if (w != null) {
                    addWarning(w);
                }
                act.close();
                //After a delete, the ResultSet will be positioned right before
View Full Code Here

   *
   * @throws SQLWarning
   */
  private void throwSQLWarning(String msg) throws SQLWarning
  {
    SQLWarning se = null;
    SQLWarning ne;
    SQLWarning ce = null;
    StringBuffer strbuf = new StringBuffer();
    StringTokenizer tokenizer = new StringTokenizer(msg, "\n");
    String sqlstate = null;
    String str;
    while (tokenizer.hasMoreTokens())
    {
      str = tokenizer.nextToken();
      //start of the next message
      if (str.charAt(5) == ':')
      {
        if (strbuf.length() > 0)
        {
          if (se == null)
          {
            se = new SQLWarning(strbuf.toString(), sqlstate);
            ce = se;
          }
          else
          {
            ne = new SQLWarning(strbuf.toString(), sqlstate);
            ce.setNextException(ne);
            ce = ne;
          }
          strbuf = new StringBuffer();
        }
        strbuf.append(str.substring(6));
        sqlstate = str.substring(0,5);
      }
      else
        strbuf.append(str);
    }
    if (strbuf.length() > 0)
    {
      if (se == null)
      {
        se = new SQLWarning(strbuf.toString(), sqlstate);
        ce = se;
      }
      else
      {
        ne = new SQLWarning(strbuf.toString(), sqlstate);
        ce.setNextException(ne);
        ce = ne;
      }
    }
    throw se;
  }
View Full Code Here

     try {
      //Note, we add database to the url so that we can allow additional
      //url attributes
      Connection conn = DriverManager.getConnection(Attribute.PROTOCOL+database, p);
      // send warnings
      SQLWarning warn = conn.getWarnings();
      if (warn != null)
        sendSQLMessage(writer, warn, SQLWARNING);
      else
        sendOK(writer);
      conn.close();
View Full Code Here

    // Now that we've processed all SET statements (assuming no
    // severe exceptions), check for warnings and, if we had any,
    // note this in the SQLCARD reply object (but DON'T cause the
    // EXCSQLSET statement to fail).
    if (hadUnrecognizedStmt) {
      SQLWarning warn = new SQLWarning("One or more SET statements " +
        "not recognized.", "01000");
      throw warn;
    } // end if.

    return;
View Full Code Here

TOP

Related Classes of java.sql.SQLWarning

Copyright © 2018 www.massapicom. 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.