Package org.springframework.jdbc

Examples of org.springframework.jdbc.UncategorizedSQLException


      else if (CONCURRENCY_CODES.contains(classCode)) {
        return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
      }
    }
    // We couldn't identify it more precisely.
    return new UncategorizedSQLException(task, sql, ex);
  }
View Full Code Here


      else if (CONCURRENCY_CODES.contains(classCode)) {
        return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
      }
    }
    // We couldn't identify it more precisely.
    return new UncategorizedSQLException(task, sql, ex);
  }
View Full Code Here

    SQLExceptionTranslator fallback = getFallbackTranslator();
    if (fallback != null) {
      return fallback.translate(task, sql, ex);
    }
    // We couldn't identify it more precisely.
    return new UncategorizedSQLException(task, sql, ex);
  }
View Full Code Here

      else if (CONCURRENCY_CODES.contains(classCode)) {
        return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
      }
    }
    // We couldn't identify it more precisely.
    return new UncategorizedSQLException(task, sql, ex);
  }
View Full Code Here

            tCon.createStatement();
            assertEquals(con, new SimpleNativeJdbcExtractor().getNativeConnection(tCon));
          }
        }
        catch (SQLException ex) {
          throw new UncategorizedSQLException("", "", ex);
        }
      }
    });

    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(dsToUse));
View Full Code Here

          if (createStatement) {
            try {
              con.createStatement();
            }
            catch (SQLException ex) {
              throw new UncategorizedSQLException("", "", ex);
            }
          }
          throw ex;
        }
      });
View Full Code Here

          assertEquals(con, new SimpleNativeJdbcExtractor().getNativeConnection(dsProxy.getConnection()));
          // should be ignored
          dsProxy.getConnection().close();
        }
        catch (SQLException ex) {
          throw new UncategorizedSQLException("", "", ex);
        }
      }
    });

    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds));
View Full Code Here

          assertEquals(con, new SimpleNativeJdbcExtractor().getNativeConnection(dsProxy.getConnection()));
          // should be ignored
          dsProxy.getConnection().close();
        }
        catch (SQLException ex) {
          throw new UncategorizedSQLException("", "", ex);
        }

        tt.execute(new TransactionCallbackWithoutResult() {
          protected void doInTransactionWithoutResult(TransactionStatus status) {
            // something transactional
            assertEquals(con, DataSourceUtils.getConnection(ds));
            try {
              assertEquals(con, ((ConnectionProxy) dsProxy.getConnection()).getTargetConnection());
              assertEquals(con, new SimpleNativeJdbcExtractor().getNativeConnection(dsProxy.getConnection()));
              // should be ignored
              dsProxy.getConnection().close();
            }
            catch (SQLException ex) {
              throw new UncategorizedSQLException("", "", ex);
            }
          }
        });

        try {
          assertEquals(con, ((ConnectionProxy) dsProxy.getConnection()).getTargetConnection());
          // should be ignored
          dsProxy.getConnection().close();
        }
        catch (SQLException ex) {
          throw new UncategorizedSQLException("", "", ex);
        }
      }
    });

    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds));
View Full Code Here

          assertEquals(con, new SimpleNativeJdbcExtractor().getNativeConnection(dsProxy.getConnection()));
          // should be ignored
          dsProxy.getConnection().close();
        }
        catch (SQLException ex) {
          throw new UncategorizedSQLException("", "", ex);
        }

        tt.execute(new TransactionCallbackWithoutResult() {
          protected void doInTransactionWithoutResult(TransactionStatus status) {
            // something transactional
            assertEquals(con, DataSourceUtils.getConnection(ds));
            try {
              assertEquals(con, ((ConnectionProxy) dsProxy.getConnection()).getTargetConnection());
              assertEquals(con, new SimpleNativeJdbcExtractor().getNativeConnection(dsProxy.getConnection()));
              // should be ignored
              dsProxy.getConnection().close();
            }
            catch (SQLException ex) {
              throw new UncategorizedSQLException("", "", ex);
            }
          }
        });

        try {
          assertEquals(con, ((ConnectionProxy) dsProxy.getConnection()).getTargetConnection());
          // should be ignored
          dsProxy.getConnection().close();
        }
        catch (SQLException ex) {
          throw new UncategorizedSQLException("", "", ex);
        }
      }
    });

    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds));
View Full Code Here

            tCon.createStatement();
            assertEquals(con, new SimpleNativeJdbcExtractor().getNativeConnection(tCon));
          }
        }
        catch (SQLException ex) {
          throw new UncategorizedSQLException("", "", ex);
        }
      }
    });

    assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(dsToUse));
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.UncategorizedSQLException

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.