Package java.sql

Examples of java.sql.SQLWarning


  @Override
  public void export(String string) throws Exception {
    statement.executeUpdate( string );
    try {
      SQLWarning warnings = statement.getWarnings();
      if ( warnings != null) {
        sqlExceptionHelper.logAndClearWarnings( connection );
      }
    }
    catch( SQLException e ) {
View Full Code Here


    }
    if ( export ) {

      statement.executeUpdate( sql );
      try {
        SQLWarning warnings = statement.getWarnings();
        if ( warnings != null) {
          sqlExceptionHelper.logAndClearWarnings( connectionHelper.getConnection() );
        }
      }
      catch( SQLException sqle ) {
View Full Code Here

    }
    if ( export ) {

      statement.executeUpdate( sql );
      try {
        SQLWarning warnings = statement.getWarnings();
        if ( warnings != null) {
          JDBCExceptionReporter.logAndClearWarnings( connectionHelper.getConnection() );
        }
      }
      catch( SQLException sqle ) {
View Full Code Here

    if ( outputFile != null ) {
      fileOutput.write( formatted + "\n" );
    }
    if ( export ) {
      statement.executeUpdate( sql );
      SQLWarning warnings = statement.getWarnings();
      if ( warnings != null) {
          JDBCExceptionReporter.logAndClearWarnings( connectionHelper.getConnection() );
      }
    }
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

        moreData = false;
        return moreData;
      }
     
      // Send ResultSet warnings if there are any
      SQLWarning sqlw = (rs != null)? rs.getWarnings(): null;
      if (rs != null) {
        rs.clearWarnings();
      }

      // for updatable, insensitive result sets we signal the
      // row updated condition to the client via a warning to be
      // popped by client onto its rowUpdated state, i.e. this
      // warning should not reach API level.
      if (rs != null && rs.rowUpdated()) {
        SQLWarning w = new SQLWarning("", SQLState.ROW_UPDATED,
            ExceptionSeverity.WARNING_SEVERITY);
        if (sqlw != null) {
          sqlw.setNextWarning(w);
        } else {
          sqlw = w;
        }
      }
      // Delete holes are manifest as a row consisting of a non-null
      // SQLCARD and a null data group. The SQLCARD has a warning
      // SQLSTATE of 02502
      if (rs != null && rs.rowDeleted()) {
        SQLWarning w = new SQLWarning("", SQLState.ROW_DELETED,
            ExceptionSeverity.WARNING_SEVERITY);
        if (sqlw != null) {
          sqlw.setNextWarning(w);
        } else {
          sqlw = w;
View Full Code Here

              int updateCount, boolean alwaysSend, boolean sendWarn)
    throws DRDAProtocolException, SQLException
  {
    // instead of writing a chain of sql warning, we send the first one, this is
    // jcc/db2 limitation, see beetle 4629
    SQLWarning warning = null;
    SQLWarning reportWarning = null;
    try
    {
      if (stmt != null)
      {
        warning = stmt.getWarnings();
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

      // don't re-display warnings we have already seen
      seenWarnings.put(warn, new java.util.Date());
      handleSQLException(warn);
    }

    SQLWarning next = warn.getNextWarning();
    if (next != warn) {
      showWarnings(next);
    }
  }
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.