Package org.apache.derby.jdbc

Examples of org.apache.derby.jdbc.EmbeddedXADataSource


    //System.setProperty("derby.stream.error.logSeverityLevel", "50000");
    //System.setProperty("derby.stream.error.file", new File(base, "derby.log").toString());
    //System.setProperty("derby.language.logStatementText", "true");
    //System.setProperty("derby.stream.error.method", "java.sql.DriverManager.getLogStream");

    dataSource = new EmbeddedXADataSource();
    dataSource.setDatabaseName(dbDir);
    dataSource.setCreateDatabase("create");

    Runtime.getRuntime().addShutdownHook(new Thread() {
      @Override
View Full Code Here


  synchronized void makeConnection(Properties p) throws
SQLException
  {
    if (xaDataSource == null)
    {
      xaDataSource = new EmbeddedXADataSource();
    }

    xaDataSource.setDatabaseName(shortDbName);
    appendAttrString(p);
    if (attrString != null)
View Full Code Here

                ex.printStackTrace();
                System.out.println("######### Couldn't get External connection! #############");
            }
        }
        if (ds == null) {
            EmbeddedXADataSource ds = new EmbeddedXADataSource();
            ds.setCreateDatabase("create");
            ds.setDatabaseName("target/testdb");
            ds.setUser("sa");
            ds.setPassword("");
            this.ds = ds;
        }
        return ds;
    }
View Full Code Here

        cpds.setUser(null);
        cpds.setPassword(null);
        cpds = null;

        // now with XADataSource
        EmbeddedXADataSource xads = new EmbeddedXADataSource();
        // XADataSource - EMPTY
        dsConnectionRequests(new String[] { 
            "08006","08006","08006","08006",
            "08006","08006","08006","08006","08006"},
            (XADataSource) xads);

        // XADataSource - databaseName=wombat
        xads.setDatabaseName(dbName);
        dsConnectionRequests(new String[] { 
            "08004","08004","08004","OK",
            "08004","08004","08004","08004","08004"},
            (XADataSource) xads);
        xads.setDatabaseName(null);

        // XADataSource - connectionAttributes=databaseName=wombat");
        xads.setConnectionAttributes("databaseName=" + dbName);
        dsConnectionRequests(new String[] { 
            "08006","08006","08006","08006",
            "08006","08006","08006","08006","08006"},
            (XADataSource) xads);
        xads.setConnectionAttributes(null);

        // XADataSource - attributesAsPassword=true
        xads.setAttributesAsPassword(true);
        dsConnectionRequests(new String[] { 
            "08006","08006","08006","08006",
            "08006","08006","08006","08006","08006"},
            (XADataSource) xads);
        xads.setAttributesAsPassword(false);

        // XADataSource - databaseName=wombat, attributesAsPassword=true
        xads.setDatabaseName(dbName);
        xads.setAttributesAsPassword(true);
        dsConnectionRequests(new String[] { 
            "08004","08004","08004","XJ028",
            "XJ028","08004","08004","OK","08004"},
            (XADataSource) xads);
        xads.setAttributesAsPassword(false);
        xads.setDatabaseName(null);
       
        setDatabaseProperty("derby.connection.requireAuthentication", "false");
        TestConfiguration.getCurrent().shutdownDatabase();
    }
View Full Code Here

    private EmbeddedXADataSource xads;

    @Init
    public void init() throws SQLException {
        // Create the database and a table
        xads = new EmbeddedXADataSource();
        xads.setDatabaseName("target/test");
        xads.setCreateDatabase("create");

        XAConnection xaconn = xads.getXAConnection();
        Connection conn = xaconn.getConnection();
View Full Code Here

        }
        public String getUserName() {
            return null;
        }
        protected static XADataSource createXADS(String dbName) {
            EmbeddedXADataSource xads = new EmbeddedXADataSource();
            xads.setDatabaseName(dbName);
            xads.setCreateDatabase("create");
            return xads;
        }
View Full Code Here

        }
        public String getUserName() {
            return null;
        }
        protected static XADataSource createXADS(String dbName) {
            EmbeddedXADataSource xads = new EmbeddedXADataSource();
            xads.setDatabaseName(dbName);
            xads.setCreateDatabase("create");
            return xads;
        }
View Full Code Here

        }
        public String getUserName() {
            return null;
        }
        protected static XADataSource createXADS(String dbName) {
            EmbeddedXADataSource xads = new EmbeddedXADataSource();
            xads.setDatabaseName(dbName);
            xads.setCreateDatabase("create");
            return xads;
        }
View Full Code Here

  synchronized void makeConnection(Properties p) throws
SQLException
  {
    if (xaDataSource == null)
    {
      xaDataSource = new EmbeddedXADataSource();
    }

    xaDataSource.setDatabaseName(shortDbName);
    appendAttrString(p);
    if (attrString != null)
View Full Code Here

        }
        public String getUserName() {
            return null;
        }
        protected static XADataSource createXADS(String dbName) {
            EmbeddedXADataSource xads = new EmbeddedXADataSource();
            xads.setDatabaseName(dbName);
            xads.setCreateDatabase("create");
            return xads;
        }
View Full Code Here

TOP

Related Classes of org.apache.derby.jdbc.EmbeddedXADataSource

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.