Package org.ow2.easybeans.tests.common.db

Examples of org.ow2.easybeans.tests.common.db.TableManager


        // The reference must be injected by the container using the xml
        // descriptor, so the jdbc_2 must be injected.
        checkResource(sessionContext, ds04, "jdbc/ds04");

        TableManager cTest00 = new TableManager(dsInjection02);
        TableManager cTest01 = new TableManager(ds05);
        try {
            // It must create twice the table, because each is in a different
            // database.
            cTest00.insertTable("ds04");
            cTest01.insertTable("ds04");

            cTest00.deleteTable("ds04");
            cTest01.deleteTable("ds04");
        } catch (Exception e) {
            throw new IllegalStateException("Exception: " + e.getMessage());
        }
    }
View Full Code Here


     * @throws SQLException if a databse error occurs.
     * @throws NamingException if a lookup error occurs.
     */
    @TransactionAttribute(value = TransactionAttributeType.REQUIRED)
    public void insertTableWithRequired(final String dbName) throws SQLException, NamingException {
        TableManager tableManager = new TableManager(dbName);
        tableManager.insertTable(TABLE);
    }
View Full Code Here

     * @throws SQLException if a databse error occurs.
     * @throws NamingException if a lookup error occurs.
     */
    @TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED)
    public void insertTableWithNotSupported(final String dbName) throws SQLException, NamingException {
        TableManager tableManager = new TableManager(dbName);
        tableManager.insertTable(TABLE);
    }
View Full Code Here

     * Tests a resource access.
     * @throws Exception if a problem occurs.
     */
    protected void access00() throws Exception{
        //Resource Test
        TableManager cTest = new TableManager(ds);
        cTest.test("ResourceTester");
    }
View Full Code Here

            HeuristicMixedException, TransactionException {
        UserTransaction utx = TransactionHelper.getUserTransaction();
        utx.begin();
        try {
            if (!callOnlyTransaction) {
                TableManager tableManager = new TableManager(dbName);
                tableManager.deleteTable(TABLE);
            }
            utx.commit();
        } catch (Exception e) {
            utx.rollback();
            throw new TransactionException("Error during commit.", e);
View Full Code Here

    public void deleteTableWithoutBegin(final boolean callOnlyTransaction, final String dbName) throws SQLException,
            NamingException, SystemException, NotSupportedException, HeuristicRollbackException, RollbackException,
            HeuristicMixedException {
        UserTransaction utx = TransactionHelper.getUserTransaction();
        if (!callOnlyTransaction) {
            TableManager tableManager = new TableManager(dbName);
            tableManager.deleteTable(TABLE);
        }
        utx.commit();

    }
View Full Code Here

            HeuristicMixedException, TransactionException {
        UserTransaction utx = TransactionHelper.getUserTransaction();
        utx.begin();
        try {
            if (!callOnlyTransaction) {
                TableManager tableManager = new TableManager(dbName);
                tableManager.insertTable(TABLE);
            }
            utx.commit();
        } catch (Exception e) {
            utx.rollback();
            throw new TransactionException("Error during commit.", e);
View Full Code Here

    public void insertTableWithoutCommit(final boolean callOnlyTransaction, final String dbName) throws SQLException,
            NamingException, SystemException, NotSupportedException {
        UserTransaction utx = TransactionHelper.getUserTransaction();
        utx.begin();
        if (!callOnlyTransaction) {
            TableManager tableManager = new TableManager(dbName);
            tableManager.insertTable(TABLE);
        }
    }
View Full Code Here

     * @param dbName is the name of the database in the registry.
     * @param tableName is the table name.
     * @throws Exception if an error occurs.
     */
    protected void insertTable(final String dbName, final String tableName) throws Exception {
        TableManager tableManager = new TableManager(dbName);
        tableManager.insertTable(tableName);
    }
View Full Code Here

     * @param dbName is the name of the database in the registry.
     * @param tableName is the table name.
     * @throws Exception if an error occurs.
     */
    protected void insertTable(final String dbName, final String tableName) throws Exception {
        TableManager tableManager = new TableManager(dbName);
        tableManager.insertTable(tableName);
    }
View Full Code Here

TOP

Related Classes of org.ow2.easybeans.tests.common.db.TableManager

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.