Package java.sql

Examples of java.sql.DataTruncation


                String source = getString();
                int transferSize = getUTF8Length(source, 0, desiredWidth);
                int dataSize = transferSize +
                        getUTF8Length(source, desiredWidth, source.length());

                DataTruncation warning = new DataTruncation(
                    -1,     // column index is unknown
                    false,  // parameter
                    true,   // read
                    dataSize,
                    transferSize);

                warning.initCause(se);

                StatementContext statementContext = (StatementContext)
                    ContextService.getContext(ContextId.LANG_STATEMENT);
                statementContext.getActivation().
                        getResultSet().addWarning(warning);
View Full Code Here


      while (warnRs.next()) {
        int code = warnRs.getInt("Code"); //$NON-NLS-1$

        if (forTruncationOnly) {
          if (code == 1265 || code == 1264) {
            DataTruncation newTruncation = new MysqlDataTruncation(
                warnRs.getString("Message"), 0, false, false, 0, 0, code); //$NON-NLS-1$

            if (currentWarning == null) {
              currentWarning = newTruncation;
            } else {
View Full Code Here

                                      true, stmt, true);

        }
      }

            DataTruncation truncated = stmt.getTruncationWarnings();
            if (truncated != null) {
                // Some of the data was truncated, so we need to add a
                // truncation warning. Save a copy of the row data, then move
                // back to the SQLCAGRP section and overwrite it with the new
                // warnings, and finally re-insert the row data after the new
                // SQLCAGRP section.
                byte[] data = writer.getBufferContents(sqlcagrpEnd);
                writer.setBufferPosition(sqlcagrpStart);
                if (sqlw != null) {
                    truncated.setNextWarning(sqlw);
                }
                writeSQLCAGRP(truncated, CodePoint.SVRCOD_WARNING, 1, -1);
                writer.writeBytes(data);
                stmt.clearTruncationWarnings();
            }
View Full Code Here

            // If invoked as part of statement execution, and the client
            // supports receiving DataTruncation warnings, add a warning about
            // the string being truncated.
            if (warnOnTruncation && stmt != null) {
                DataTruncation dt = new DataTruncation(
                        index,
                        isParameter,
                        true,  // this is a warning for a read operation
                        s.length(),                   // dataSize
                        s.length() - truncatedChars); // transferSize
View Full Code Here

      while (warnRs.next()) {
        int code = warnRs.getInt("Code"); //$NON-NLS-1$

        if (forTruncationOnly) {
          if (code == 1265 || code == 1264) {
            DataTruncation newTruncation = new MysqlDataTruncation(
                warnRs.getString("Message"), 0, false, false, 0, 0, code); //$NON-NLS-1$

            if (currentWarning == null) {
              currentWarning = newTruncation;
            } else {
View Full Code Here

      while (warnRs.next()) {
        int code = warnRs.getInt("Code"); //$NON-NLS-1$

        if (forTruncationOnly) {
          if (code == 1265 || code == 1264) {
            DataTruncation newTruncation = new MysqlDataTruncation(
                warnRs.getString("Message"), 0, false, false, 0, 0, code); //$NON-NLS-1$

            if (currentWarning == null) {
              currentWarning = newTruncation;
            } else {
View Full Code Here

TOP

Related Classes of java.sql.DataTruncation

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.