Package org.h2.jdbcx

Examples of org.h2.jdbcx.JdbcDataSource


    final String url = "jdbc:h2:file:" + tempDirectory.getAbsolutePath() + "/h2db";
    final String user = "sa";
    final String password = "";

    //H2 DataSource creation
    final JdbcDataSource underlyingDataSource = new JdbcDataSource();
    underlyingDataSource.setURL( url );
    underlyingDataSource.setUser( user );
    underlyingDataSource.setPassword( password );

    //build JBoss-bound DataSource
    DataSource ds = new JBossTADataSourceBuilder()
        .setXADataSource( underlyingDataSource )
        .setUser( user )
View Full Code Here


        return jdbcTemplate;
    }

    protected DataSource createDataSource() throws SQLException {
        JdbcDataSource dataSource = new JdbcDataSource();

        dataSource.setURL("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1");
        dataSource.setUser("");
        dataSource.setPassword("");

        return dataSource;
    }
View Full Code Here

        }

        String jdbcUrl = jdbcUrlBuilder.toString();

        // create dataSource
        dataSource = new JdbcDataSource();
        dataSource.setURL(jdbcUrl);
        dataSource.setUser("sa");
        if (config.getCipher() != Cipher.NONE) {
            dataSource.setPassword(config.getFilePassword() + " ");
        }
View Full Code Here

      Class.forName("org.h2.Driver");
    } catch (ClassNotFoundException e) {
      logger.error(null, e);
    }

    JdbcDataSource ds = new JdbcDataSource();
    ds.setURL(url);
    ds.setUser("sa");
    ds.setPassword("");
    cp = JdbcConnectionPool.create(ds);
  }
View Full Code Here

        }

        String jdbcUrl = jdbcUrlBuilder.toString();

        // create dataSource
        dataSource = new JdbcDataSource();
        dataSource.setURL(jdbcUrl);
        dataSource.setUser("sa");
        if (config.getCipher() != Cipher.NONE) {
            dataSource.setPassword(config.getFilePassword() + " ");
        }
View Full Code Here

     */
    public H2Consumer(File dbFileName, File chartsDir, String customKeyValue)
    {
        try
        {
            final JdbcDataSource ds = new org.h2.jdbcx.JdbcDataSource();
            ds.setURL("jdbc:h2:" + dbFileName.getAbsolutePath() + ";DB_CLOSE_ON_EXIT=FALSE");
            ds.setUser("sa");

            this.chartsDir = chartsDir;
            this.chartVisitors = newChartVisitors();
   
            this.connection = ds.getConnection();
            connection.setAutoCommit(false);
            super.addAutoclose(this);

            checkSchema();

View Full Code Here

    }

    @Override
    protected Connection createConnection() throws SQLException
    {
        final JdbcDataSource ds = new org.h2.jdbcx.JdbcDataSource();
        ds.setURL("jdbc:h2:" + dbFileName.getAbsolutePath() + ";DB_CLOSE_ON_EXIT=FALSE");
        ds.setUser("sa");
        Connection results = ds.getConnection();
        results.setAutoCommit(false);
        return results;
    }
View Full Code Here

     */
    @Override
    public DataSource getDataSource(final Map<String, String> attributes) {
        final Map<String, String> actualAttributes = new HashMap<String, String>(attributes);
        actualAttributes.put("DB_CLOSE_DELAY", "-1");
        final JdbcDataSource dataSource = new JdbcDataSource();
        dataSource.setURL(getUrl(actualAttributes));
        dataSource.setUser(getUsername());
        dataSource.setPassword(getPassword());
        return dataSource;
    }
View Full Code Here

    super(buildDataSource());
  }

  private static JdbcDataSource buildDataSource() {
    // Setup in-memory H2 JDBC DataSource;
    JdbcDataSource dataSource = new JdbcDataSource();
    dataSource.setURL("jdbc:h2:mem:testdb");
    dataSource.setUser("sa");
    dataSource.setPassword("sa");
    return dataSource;
  }
View Full Code Here

    // Setup the ConnectorType.
    connectorTypeName = "LocalDatabaseConnectorType";
    connectorType = new LocalDatabaseConnectorType();

    // Setup in-memory H2 JDBC DataSource;
    JdbcDataSource ds = new JdbcDataSource();
    ds.setURL("jdbc:h2:mem:testdb");
    ds.setUser("sa");
    ds.setPassword("sa");
    dataSource = ds;
    database = new JdbcDatabase(dataSource);

    // Setup LocalDatabase
    localDatabase =
View Full Code Here

TOP

Related Classes of org.h2.jdbcx.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.