Package java.sql

Examples of java.sql.SQLException.printStackTrace()


        ex.printStackTrace(ps);
        ex.printStackTrace(pw);
        ex = new SQLNestedException(null, null);
        ex.printStackTrace();
        ex.printStackTrace(ps);
        ex.printStackTrace(pw);
    }
}
View Full Code Here


        this.setUp("fmLogEntry", "log4j2-" + this.databaseType + "-factory-method.xml");

        final SQLException exception = new SQLException("Some other error message!");
        final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        final PrintWriter writer = new PrintWriter(outputStream);
        exception.printStackTrace(writer);
        writer.close();
        final String stackTrace = outputStream.toString();

        final long millis = System.currentTimeMillis();
View Full Code Here

        this.setUp("fmLogEntry", "log4j2-" + this.databaseType + "-factory-method.xml");

        final SQLException exception = new SQLException("Some other error message!");
        final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        final PrintWriter writer = new PrintWriter(outputStream);
        exception.printStackTrace(writer);
        writer.close();
        final String stackTrace = outputStream.toString();

        final long millis = System.currentTimeMillis();
View Full Code Here

                        sb.append(
                            "SQLException during commit, logging nested exceptions before throwing EntityStoreException:\n" );
                        SQLException e = sqle;
                        while( e != null )
                        {
                            e.printStackTrace( new PrintWriter( sb, true ) );
                            e = e.getNextException();
                        }
                        LOGGER.debug( sb.toString() );
                    }
                    throw new EntityStoreException( sqle );
View Full Code Here

     */
    public static void printStackTrace(SQLException e, PrintWriter pw) {

        SQLException next = e;
        while (next != null) {
            next.printStackTrace(pw);
            next = next.getNextException();
            if (next != null) {
                pw.println("Next SQLException:");
            }
        }
View Full Code Here

    private void sendError(Throwable t) {
        try {
            SQLException e = DbException.convert(t).getSQLException();
            StringWriter writer = new StringWriter();
            e.printStackTrace(new PrintWriter(writer));
            String trace = writer.toString();
            String message;
            String sql;
            if (e instanceof JdbcSQLException) {
                JdbcSQLException j = (JdbcSQLException) e;
View Full Code Here

    catch (SQLException e)
    {
      if (pg != null)
      {
        System.err.println("Attempted both upper and lower-case column names in queries, both failed.");
        pg.printStackTrace();
        throw pg;
      }
      e.printStackTrace();
      throw e; // don't suppress the exception!
    }
View Full Code Here

    catch (SQLException e)
    {
      if (pg != null)
      {
        System.err.println("Attempted both upper and lower-case column names in queries, both failed.");
        pg.printStackTrace();
        throw pg;
      }
      e.printStackTrace();
      throw e; // don't suppress the exception!
    }
View Full Code Here

      System.out.print("SQLSTATE("+se.getSQLState()+"):");
            lastSe = se;
      se = se.getNextException();
    }
    System.out.println("");
        lastSe.printStackTrace(System.out);
  }
   
}       

View Full Code Here

            PrintWriter out = new PrintWriter(msg);
            out.println(totalError + " select/compile errors reported:");
            for (Iterator ei = errors.iterator(); ei.hasNext(); ) {
                out.println("------");
                SQLException sqle = (SQLException)ei.next();
                sqle.printStackTrace(out);
            }
            out.close();
            fail(msg.toString());
        }
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.