Package org.hsqldb.jdbc

Examples of org.hsqldb.jdbc.jdbcDataSource


        new File("testdb.backup").delete();
        new File("testdb.data").delete();
        new File("testdb.properties").delete();
        new File("testdb.script").delete();

        jdbcDataSource dataSource = new jdbcDataSource();

        dataSource.setDatabase("jdbc:hsqldb:testdb");

        Connection con   = dataSource.getConnection("sa", "");
        String[]   saDDL = {
            "CREATE CACHED TABLE XB (EIACODXA VARCHAR(10) NOT NULL, LSACONXB VARCHAR(18) NOT NULL, ALTLCNXB VARCHAR(2) NOT NULL, LCNTYPXB VARCHAR(1) NOT NULL, LCNINDXB VARCHAR(1), LCNAMEXB VARCHAR(19), UPDT_BY VARCHAR(32), LST_UPDT TIMESTAMP, CONSTRAINT XPKXB PRIMARY KEY (EIACODXA, LSACONXB, ALTLCNXB, LCNTYPXB));",

//            "CREATE INDEX XIF2XB ON XB (EIACODXA);",
            "CREATE CACHED TABLE CA ( EIACODXA VARCHAR(10) NOT NULL, LSACONXB VARCHAR(18) NOT NULL, ALTLCNXB VARCHAR(2) NOT NULL, LCNTYPXB VARCHAR(1) NOT NULL, TASKCDCA VARCHAR(7) NOT NULL, TSKFRQCA NUMERIC(7,4), UPDT_BY VARCHAR(32), LST_UPDT TIMESTAMP, CONSTRAINT XPKCA PRIMARY KEY (EIACODXA, LSACONXB, ALTLCNXB, LCNTYPXB, TASKCDCA),        CONSTRAINT R_XB_CA FOREIGN KEY (EIACODXA, LSACONXB, ALTLCNXB, LCNTYPXB) REFERENCES XB ON DELETE CASCADE);",
View Full Code Here


    static void testURL(String url, String tableAttr) throws SQLException {

        System.out.println(url);

        jdbcDataSource dataSource = new jdbcDataSource();

        dataSource.setDatabase(url);

        Connection con = dataSource.getConnection("sa", "");

        reCreateTable(con, "CACHED");
        populateTable(con);
        con.close();
    }
View Full Code Here

    public void init() throws Exception {

        String driver = "org.hsqldb.jdbcDriver";
        String url    = "jdbc:hsqldb:file:testing/test";

        jdbcDataSource dataSource = new jdbcDataSource();

        dataSource.setDatabase(url);

        con = dataSource.getConnection("sa", "");

        con.setAutoCommit(true);

        // set cache sizes
        Statement stmt = con.createStatement();
View Full Code Here

        // Exceptions may occur
        try {

            // get a DataSource object and set the URL
            // 'testfiles' in the URL is the name of the database
            jdbcDataSource dataSource = new jdbcDataSource();

            dataSource.setDatabase("jdbc:hsqldb:file:testfiles");

            // Connect to the database
            // It will be create automatically if it does not yet exist
            // "sa" is the user name and "" is the (empty) password
            Connection conn = dataSource.getConnection("SA", "");

            // Check the command line parameters
            if (arg.length == 1) {

                // One parameter:
View Full Code Here

        // database if it is not alread running.
        // db_file_name_prefix is used to open or create files that hold the state
        // of the db.
        // It can contain directory names relative to the
        // current working directory
        jdbcDataSource dataSource = new jdbcDataSource();

        dataSource.setDatabase("jdbc:hsqldb:" + db_file_name_prefix);

        Connection c = dataSource.getConnection("sa", "");
    }
View Full Code Here

        }

        handlerCollection.addHandler( new DefaultHandler() );
       
        // 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);
       
View Full Code Here

    }

    public void testDirectDataSource() throws Exception {
        Properties properties = new Properties();

        DataSource dataSource = new jdbcDataSource();
        properties.put("DataSource", dataSource);

        ActiveMQFactory.setThreadProperties(properties);
        BrokerService broker = null;
        try {
View Full Code Here

    }

    public void testLookupDataSource() throws Exception {
        Properties properties = new Properties();

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

        CoreContainerSystem containerSystem = new CoreContainerSystem(new IvmJndiFactory());
        containerSystem.getJNDIContext().bind("openejb/Resource/TestDs", dataSource);
View Full Code Here

            throw new IllegalArgumentException("Config directory is not a directory or does not exist: " + configDir);
        this._configDir = configDir;
    }

    public static DataSource createInternalDS(String guid) {
        jdbcDataSource hsqlds = new jdbcDataSource();
        hsqlds.setDatabase("jdbc:hsqldb:mem:" + guid);
        hsqlds.setUser("sa");
        hsqlds.setPassword("");
        return hsqlds;
    }
View Full Code Here

    BPELDAOConnectionFactoryImpl factory;
    ProcessDAO _process;

    @Override
    protected void setUp() throws Exception {
        jdbcDataSource hsqlds = new jdbcDataSource();
        hsqlds.setDatabase("jdbc:hsqldb:mem:" + new GUID().toString());
        hsqlds.setUser("sa");
        hsqlds.setPassword("");
        _ds = hsqlds;

        _txm = new EmbeddedGeronimoFactory().getTransactionManager();

        factory = new BPELDAOConnectionFactoryImpl();
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.