/** * Return the underlying SQLException. */ public SQLException getSQLException() { return (SQLException) getCause(); }
/** * Return the underlying SQLException. */ public SQLException getSQLException() { return (SQLException) getCause(); }
/** * Return the underlying SQLException. */ public SQLException getSQLException() { return (SQLException) getCause(); }
@Override public String testSqlGrammar( String sql ) { String viewName = SqlView.PREFIX_VIEWNAME + System.currentTimeMillis(); sql = "CREATE VIEW " + viewName + " AS " + sql; log.debug( "Test view SQL: " + sql ); try { jdbcTemplate.execute( sql ); jdbcTemplate.execute( "DROP VIEW IF EXISTS " + viewName ); } catch ( BadSqlGrammarException ex ) { return ex.getCause().getMessage(); } catch ( UncategorizedSQLException ex ) { return ex.getCause().getMessage(); } return null; }