Examples of DriverManagerDataSource


Examples of org.springframework.jdbc.datasource.DriverManagerDataSource

    }
  }

  public void testSetTypeAfterCompile() {
    TestRdbmsOperation operation = new TestRdbmsOperation();
    operation.setDataSource(new DriverManagerDataSource());
    operation.setSql("select * from mytable");
    operation.compile();
    try {
      operation.setTypes(new int[] {Types.INTEGER });
      fail("Shouldn't allow setting parameters after compile");
View Full Code Here

Examples of org.springframework.jdbc.datasource.DriverManagerDataSource

    }
  }

  public void testDeclareParameterAfterCompile() {
    TestRdbmsOperation operation = new TestRdbmsOperation();
    operation.setDataSource(new DriverManagerDataSource());
    operation.setSql("select * from mytable");
    operation.compile();
    try {
      operation.declareParameter(new SqlParameter(Types.INTEGER));
      fail("Shouldn't allow setting parameters after compile");
View Full Code Here

Examples of org.springframework.jdbc.datasource.DriverManagerDataSource

    }
  }

  public void testCompileTwice() {
    TestRdbmsOperation operation = new TestRdbmsOperation();
    operation.setDataSource(new DriverManagerDataSource());
    operation.setSql("select * from mytable");
    operation.setTypes(null);
    operation.compile();
    operation.compile();
  }
View Full Code Here

Examples of org.springframework.jdbc.datasource.DriverManagerDataSource

  }

  public void testParameterPropagation() {
    SqlOperation operation = new SqlOperation() {
    };
    DataSource ds = new DriverManagerDataSource();
    operation.setDataSource(ds);
    operation.setFetchSize(10);
    operation.setMaxRows(20);
    JdbcTemplate jt = operation.getJdbcTemplate();
    assertEquals(ds, jt.getDataSource());
View Full Code Here

Examples of org.springframework.jdbc.datasource.DriverManagerDataSource

    assertEquals(20, jt.getMaxRows());
  }

  public void testValidateInOutParameter() {
    TestRdbmsOperation operation = new TestRdbmsOperation();
    operation.setDataSource(new DriverManagerDataSource());
    operation.setSql("DUMMY_PROC");
    operation.declareParameter(new SqlOutParameter("DUMMY_OUT_PARAM", Types.VARCHAR));
    operation.declareParameter(new SqlInOutParameter("DUMMY_IN_OUT_PARAM", Types.VARCHAR));
    operation.validateParameters(new Object[] {"DUMMY_VALUE1", "DUMMY_VALUE2"});
  }
View Full Code Here

Examples of org.springframework.jdbc.datasource.DriverManagerDataSource

    operation.validateParameters(new Object[] {"DUMMY_VALUE1", "DUMMY_VALUE2"});
  }

  public void testParametersSetWithList() {
    TestRdbmsOperation operation = new TestRdbmsOperation();
    DataSource ds = new DriverManagerDataSource();
    operation.setDataSource(ds);
    operation.setSql("select * from mytable where one = ? and two = ?");
    List l = new ArrayList();
    l.add(new SqlParameter("one", Types.NUMERIC));
    l.add(new SqlParameter("two", Types.VARCHAR));
View Full Code Here

Examples of org.springframework.jdbc.datasource.DriverManagerDataSource

* @since 05.03.2005
*/
public class LocalSessionFactoryBeanTests extends TestCase {

  public void testLocalSessionFactoryBeanWithDataSource() throws Exception {
    final DriverManagerDataSource ds = new DriverManagerDataSource();
    final List invocations = new ArrayList();
    LocalSessionFactoryBean sfb = new LocalSessionFactoryBean() {
      protected Configuration newConfiguration() {
        return new Configuration() {
          public Configuration addInputStream(InputStream is) {
View Full Code Here

Examples of org.springframework.jdbc.datasource.DriverManagerDataSource

    assertTrue(sfb.getConfiguration() != null);
    assertEquals("newSessionFactory", invocations.get(0));
  }

  public void testLocalSessionFactoryBeanWithTransactionAwareDataSource() throws Exception {
    final DriverManagerDataSource ds = new DriverManagerDataSource();
    final List invocations = new ArrayList();
    LocalSessionFactoryBean sfb = new LocalSessionFactoryBean() {
      protected Configuration newConfiguration() {
        return new Configuration() {
          public Configuration addInputStream(InputStream is) {
View Full Code Here

Examples of org.springframework.jdbc.datasource.DriverManagerDataSource

    assertTrue(sfb.getConfiguration() != null);
    assertEquals("newSessionFactory", invocations.get(0));
  }

  public void testLocalSessionFactoryBeanWithDataSourceAndMappingResources() throws Exception {
    final DriverManagerDataSource ds = new DriverManagerDataSource();
    MockControl tmControl = MockControl.createControl(TransactionManager.class);
    final TransactionManager tm = (TransactionManager) tmControl.getMock();
    final List invocations = new ArrayList();
    LocalSessionFactoryBean sfb = new LocalSessionFactoryBean() {
      protected Configuration newConfiguration() {
View Full Code Here

Examples of org.springframework.jdbc.datasource.DriverManagerDataSource

    assertEquals("addResource", invocations.get(1));
    assertEquals("newSessionFactory", invocations.get(2));
  }

  public void testLocalSessionFactoryBeanWithDataSourceAndMappingJarLocations() throws Exception {
    final DriverManagerDataSource ds = new DriverManagerDataSource();
    final Set invocations = new HashSet();
    LocalSessionFactoryBean sfb = new LocalSessionFactoryBean() {
      protected Configuration newConfiguration() {
        return new Configuration() {
          public Configuration addJar(File file) {
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.