Package java.sql

Examples of java.sql.SQLException.printStackTrace()


        exc.getCause().printStackTrace(out);
        if (exc.getCause() instanceof SQLException) {
          SQLException se = (SQLException)exc.getCause();
          SQLException next = se.getNextException();
          if (next != null) {
            next.printStackTrace(out);
          }
        }
        out.println("*/");
      }
      out.flush();
 
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

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

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

    public static void printStackTrace(SQLException sqle, PrintWriter pw) {

        SQLException next = sqle;
        while (next != null) {
            next.printStackTrace(pw);
            next = next.getNextException();
            if (next != null) {
                pw.println("Next SQLException:");
            }
        }
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

    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

        PrintWriter pw = new PrintWriter(System.err);
        SQLException ex;
       
        DriverManager.setLogWriter(pw);
        ex = new SQLNestedException("A", new Exception("a"));
        ex.printStackTrace();
        ex.printStackTrace(ps);
        ex.printStackTrace(pw);
        ex = new SQLNestedException("B", null);
        ex.printStackTrace();
        ex.printStackTrace(ps);
View Full Code Here

        SQLException ex;
       
        DriverManager.setLogWriter(pw);
        ex = new SQLNestedException("A", new Exception("a"));
        ex.printStackTrace();
        ex.printStackTrace(ps);
        ex.printStackTrace(pw);
        ex = new SQLNestedException("B", null);
        ex.printStackTrace();
        ex.printStackTrace(ps);
        ex.printStackTrace(pw);
View Full Code Here

       
        DriverManager.setLogWriter(pw);
        ex = new SQLNestedException("A", new Exception("a"));
        ex.printStackTrace();
        ex.printStackTrace(ps);
        ex.printStackTrace(pw);
        ex = new SQLNestedException("B", null);
        ex.printStackTrace();
        ex.printStackTrace(ps);
        ex.printStackTrace(pw);
        ex = new SQLNestedException(null, new Exception("c"));
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.