Package org.hsqldb.jdbc

Examples of org.hsqldb.jdbc.jdbcDataSource


    injector.getInstance(UnitOfWork.class).end();
    injector.getInstance(EntityManagerFactory.class).close();
  }

  private static DataSource getDataSource() {
    final JDBCDataSource dataSource = new JDBCDataSource();
    dataSource.setDatabase("jdbc:hsqldb:mem:persistence");
    dataSource.setUser("sa");
    dataSource.setPassword("");
    return dataSource;
  }
View Full Code Here


    JdbcDataSource realDs2 = new JdbcDataSource();
    realDs2.setUser("sa");
    realDs2.setURL("jdbc:h2:mem:multids2");
    jndiResources.add(new Resource("jdbc/realDs2", realDs2));

    JDBCDataSource realDs3 = new JDBCDataSource();
    realDs3.setUser("sa");
    realDs3.setPassword("");
    realDs3.setUrl("jdbc:hsqldb:mem:multids3");
    jndiResources.add(new Resource("jdbc/realDs3", realDs3));

    // create the spy wrapper data sources and bind to jndi
    P6DataSource spyDs1 = new P6DataSource();
    spyDs1.setRealDataSource("jdbc/realDs1");
View Full Code Here

        // setup the hsqldb database engine
        m_hu.setUp();

        // Create the connection pool
        JDBCDataSource cpds = new JDBCDataSource();
        cpds.setDatabase( "jdbc:hsqldb:hsql://localhost/jspwiki" );
        cpds.setLoginTimeout( 10 );
        cpds.setUser( "SA" );
        cpds.setPassword( null );

        // Configure and bind DataSource to JNDI for user database
        userDB = new Resource( "jdbc/UserDatabase", cpds );
        log.error( "Configured datasource " + userDB);
        userDB.bindToENC("jdbc/UserDatabase");
View Full Code Here

    public void testDirectDataSource() throws Exception {

        final Properties properties = new Properties();

        final JDBCDataSource dataSource = new JDBCDataSource();
        dataSource.setDatabase("jdbc:hsqldb:mem:testdb" + System.currentTimeMillis());
        dataSource.setUser("sa");
        dataSource.setPassword("");
        dataSource.getConnection().close();

        properties.put("DataSource", dataSource);
        properties.put("UseDatabaseLock", "false");

        ActiveMQFactory.setThreadProperties(properties);
View Full Code Here

    public void testLookupDataSource() throws Exception {

        final Properties properties = new Properties();

        final JDBCDataSource dataSource = new JDBCDataSource();
        dataSource.setDatabase("jdbc:hsqldb:mem:testdb" + System.currentTimeMillis());
        dataSource.setUser("sa");
        dataSource.setPassword("");
        dataSource.getConnection().close();

        MockInitialContextFactory.install(Collections.singletonMap("openejb/Resource/TestDs", dataSource));
        assertSame(dataSource, new InitialContext().lookup("openejb/Resource/TestDs"));

        final CoreContainerSystem containerSystem = new CoreContainerSystem(new IvmJndiFactory());
View Full Code Here

        assertEquals("sa", bds.getUsername());
        assertEquals("", bds.getPassword());

        final Field fieldDs = bds.getClass().getDeclaredField("ds");
        fieldDs.setAccessible(true);
        final JDBCDataSource realDs = (JDBCDataSource) fieldDs.get(bds);
        assertEquals("jdbc:hsqldb:mem:superDS", realDs.getUrl());
        assertEquals("sa", realDs.getUser());
    }
View Full Code Here

     * @return Returns {@code dataSource} which was initialised by the
     *         constructor.
     */
    @Override
    public DataSource getDataSource(final Map<String, String> attributes) {
        final JDBCDataSource dataSource = new JDBCDataSource();
        dataSource.setUrl(getUrl(attributes));
        dataSource.setUser(getUsername());
        dataSource.setPassword(getPassword());
        return dataSource;
    }
View Full Code Here

    {
      System.out.println(genre);
      System.out.println(title);
      System.out.println(author);

      JDBCDataSource ds = new JDBCDataSource();
     
      // setup URL according to HSQLDB specs
      ds.setUrl("jdbc:hsqldb:hsql://localhost/");
     
      // set other data source properties
      ds.setPassword("");
      ds.setUser("SA");

     
      conn = ds.getConnection();
      stmt = conn.createStatement();
     
      String querySQL = "select * from book";
     
      if(StringUtils.isNotBlank(title) || StringUtils.isNotBlank(author) || StringUtils.isNotBlank(genre))
View Full Code Here

public class ConsoleJDBC {
  public static void main(String[] args)
  {
    try {
      JDBCDataSource ds = new JDBCDataSource();
     
      // setup URL according to HSQLDB specs
      ds.setUrl("jdbc:hsqldb:hsql://localhost/");
     
      // set other data source properties
      ds.setPassword("");
      ds.setUser("SA");
     
      // setup connection and query
      Connection conn = ds.getConnection();
      Statement statement = conn.createStatement();
     
      // send query to database
      ResultSet rs = statement.executeQuery("select * from Book");
      ResultSetMetaData rsmd = rs.getMetaData();
View Full Code Here

    public void testDirectDataSource() throws Exception {

        final Properties properties = new Properties();

        final JDBCDataSource dataSource = new JDBCDataSource();
        dataSource.setDatabase("jdbc:hsqldb:mem:testdb" + System.currentTimeMillis());
        dataSource.setUser("sa");
        dataSource.setPassword("");
        dataSource.getConnection().close();

        properties.put("DataSource", dataSource);
        properties.put("UseDatabaseLock", "false");
        properties.put("StartupTimeout", "10000");
View Full Code Here

TOP

Related Classes of org.hsqldb.jdbc.jdbcDataSource

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.