Examples of SQLWarning


Examples of java.sql.SQLWarning

        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

Examples of java.sql.SQLWarning

              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

Examples of java.sql.SQLWarning

                {
                    printResults(out);
                }
            }

            SQLWarning warning = conn.getWarnings();
            while (warning != null)
            {
                log(warning + " sql warning", Project.MSG_VERBOSE);
                warning = warning.getNextWarning();
            }
            conn.clearWarnings();
            goodSql++;
        }
        catch (SQLException e)
View Full Code Here

Examples of java.sql.SQLWarning

    }
  }

  public final SQLWarning getWarnings() {
    SQLWarning w = warnings;
    warnings = null;
    return w;
  }
View Full Code Here

Examples of java.sql.SQLWarning

    }
  }

  public final SQLWarning getWarnings() {
    SQLWarning w = warnings;
    warnings = null;
    return w;
  }
View Full Code Here

Examples of java.sql.SQLWarning

    all the connections made so far.
      */
        public ijResult showConnectionsMethod(boolean ignore0Rows) throws SQLException {
                Hashtable ss = currentConnEnv.getSessions();
                Vector v = new Vector();
                SQLWarning w = null;
        if (ss == null || ss.size() == 0) {
                if (!ignore0Rows)
                v.addElement(LocalizedResource.getMessage("IJ_NoConneAvail"));
        }
        else {
View Full Code Here

Examples of java.sql.SQLWarning

                ps = session.getConnection().prepareStatement(sVal);
                JDBCDisplayUtil.checkNotNull(ps,"prepared statement");
                session.addPreparedStatement(qi.getLocalName(),ps);

                // all we want callers to see are the warnings.
                SQLWarning w = ps.getWarnings();
                ps.clearWarnings();
                {if (true) return new ijWarningResult(w);}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

Examples of java.sql.SQLWarning

        int holdType = theConnection.getHoldability();
        QualifiedIdentifier qi;
        Statement st = null;
        String sVal;
        ResultSet rs = null;
        SQLWarning warns;
    jj_consume_token(GET);
    if (jj_2_99(2)) {
      scrolling = jj_consume_token(SCROLL);
      scrollType = scrollType();
    } else {
      ;
    }
    if (jj_2_100(2)) {
      withtoken = jj_consume_token(WITH);
      holdType = holdType();
    } else {
      ;
    }
    jj_consume_token(CURSOR);
    qi = qualifiedIdentifier();
    jj_consume_token(AS);
    s = jj_consume_token(STRING);
                sVal = stringValue(s.image);
                try {
                        Session sn = findSession(qi.getSessionName());

                        st = sn.getConnection().createStatement(
                                scrollType, ResultSet.CONCUR_READ_ONLY, holdType);
                        JDBCDisplayUtil.checkNotNull(st,"cursor");
                        st.setCursorName(qi.getLocalName());
                        rs = st.executeQuery(sVal);
                        JDBCDisplayUtil.checkNotNull(rs,"cursor");
                        sn.addCursorStatement(qi.getLocalName(),st);
                        sn.addCursor(qi.getLocalName(),rs);
                } catch (SQLException e) {
                        if (rs!=null) rs.close();
                        if (st!=null) st.close();
                        {if (true) throw e;}
                }

                // all we want callers to see are the warnings.
                SQLWarning w1 = theConnection.getWarnings();
                SQLWarning w2 = st.getWarnings();
                SQLWarning w3 = rs.getWarnings();
                theConnection.clearWarnings();
                st.clearWarnings();
                rs.clearWarnings();
                warns = appendWarnings(w1,w2);
                {if (true) return new ijWarningResult(appendWarnings(warns,w3));}
View Full Code Here

Examples of java.sql.SQLWarning

      ;
    }
            if (qiUsing!=null || sUsing!=null) { // parameters in use
                        String sUsingVal = null;
                        PreparedStatement psUsing;
                        SQLWarning warns = null;

                        // haveConnection();

                        /*
        Steps:
 
View Full Code Here

Examples of java.sql.SQLWarning

   *
   * @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
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.