Search in sources :

Example 16 with FBManager

use of org.firebirdsql.management.FBManager in project jaybird by FirebirdSQL.

the class TestSpecialEmbeddedServerUrls method setUp.

@Before
public void setUp() throws Exception {
    Class.forName(FBDriver.class.getName());
    gdsType = GDSType.getType(EmbeddedGDSFactoryPlugin.EMBEDDED_TYPE_NAME);
    fbManager = new FBManager(gdsType);
    fbManager.setServer("localhost");
    fbManager.setPort(5066);
    fbManager.start();
    File dbFolder = temporaryFolder.newFolder("db");
    mRelativeDatabasePath = "testES01874.fdb";
    mAbsoluteDatabasePath = new File(dbFolder, mRelativeDatabasePath).getAbsolutePath();
    fbManager.createDatabase(mAbsoluteDatabasePath, "SYSDBA", "masterkey");
}
Also used : FBManager(org.firebirdsql.management.FBManager) FBDriver(org.firebirdsql.jdbc.FBDriver) File(java.io.File)

Example 17 with FBManager

use of org.firebirdsql.management.FBManager in project jaybird by FirebirdSQL.

the class TestSpecialEmbeddedServerUrls method testDriverManagerGetConnectionWithoutServerAndPortInUrlWithRelativeDatabasePath.

@Test
public void testDriverManagerGetConnectionWithoutServerAndPortInUrlWithRelativeDatabasePath() throws Exception {
    FBManager testFBManager = new FBManager(gdsType);
    testFBManager.setDropOnStop(true);
    try {
        testFBManager.start();
        testFBManager.createDatabase(mRelativeDatabasePath, "SYSDBA", "masterkey");
        try (Connection connection = DriverManager.getConnection("jdbc:firebirdsql:embedded:" + mRelativeDatabasePath + "?encoding=NONE", "SYSDBA", "masterkey")) {
            assertTrue(connection.isValid(1000));
        }
    } finally {
        testFBManager.stop();
    }
}
Also used : FBManager(org.firebirdsql.management.FBManager) Connection(java.sql.Connection)

Example 18 with FBManager

use of org.firebirdsql.management.FBManager in project jaybird by FirebirdSQL.

the class TestSpecialEmbeddedServerUrls method testFBManagerWithoutSettingServerAndPort.

@Test
public void testFBManagerWithoutSettingServerAndPort() throws Exception {
    FBManager testFBManager = new FBManager(gdsType);
    testFBManager.start();
    testFBManager.dropDatabase(mAbsoluteDatabasePath, "SYSDBA", "masterkey");
    testFBManager.createDatabase(mAbsoluteDatabasePath, "SYSDBA", "masterkey");
    testFBManager.stop();
}
Also used : FBManager(org.firebirdsql.management.FBManager)

Example 19 with FBManager

use of org.firebirdsql.management.FBManager in project jaybird by FirebirdSQL.

the class TestServicesAPI method setUp.

@Before
public void setUp() throws Exception {
    Class.forName(FBDriver.class.getName());
    gdsType = GDSType.getType(EmbeddedGDSFactoryPlugin.EMBEDDED_TYPE_NAME);
    dbFactory = GDSFactory.getDatabaseFactoryForType(gdsType);
    fbManager = new FBManager(gdsType);
    fbManager.setServer("localhost");
    fbManager.setPort(5066);
    fbManager.start();
    File dbFolder = temporaryFolder.newFolder("db");
    logFolder = temporaryFolder.newFolder("log");
    mAbsoluteBackupPath = new File(dbFolder, "testES01344.fbk").getAbsolutePath();
    mAbsoluteDatabasePath = new File(dbFolder, "testES01344.fdb").getAbsolutePath();
    fbManager.createDatabase(mAbsoluteDatabasePath, "SYSDBA", "masterkey");
}
Also used : FBManager(org.firebirdsql.management.FBManager) FBDriver(org.firebirdsql.jdbc.FBDriver)

Example 20 with FBManager

use of org.firebirdsql.management.FBManager in project jaybird by FirebirdSQL.

the class TestServicesAPI method dropDatabase.

private void dropDatabase() throws Exception {
    final FBManager testFBManager = new FBManager(gdsType);
    testFBManager.start();
    testFBManager.dropDatabase(mAbsoluteDatabasePath, "SYSDBA", "masterkey");
    testFBManager.stop();
}
Also used : FBManager(org.firebirdsql.management.FBManager)

Aggregations

FBManager (org.firebirdsql.management.FBManager)26 Test (org.junit.Test)17 FbWireDatabase (org.firebirdsql.gds.ng.wire.FbWireDatabase)9 WireDatabaseConnection (org.firebirdsql.gds.ng.wire.WireDatabaseConnection)9 AbstractFbWireDatabase (org.firebirdsql.gds.ng.wire.AbstractFbWireDatabase)8 Connection (java.sql.Connection)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 File (java.io.File)2 SQLException (java.sql.SQLException)2 Properties (java.util.Properties)2 FBTestProperties (org.firebirdsql.common.FBTestProperties)2 ServiceRequestBuffer (org.firebirdsql.gds.ServiceRequestBuffer)2 FbConnectionProperties (org.firebirdsql.gds.ng.FbConnectionProperties)2 FBDriver (org.firebirdsql.jdbc.FBDriver)2 GDSType (org.firebirdsql.gds.impl.GDSType)1 FbTransaction (org.firebirdsql.gds.ng.FbTransaction)1 AbstractFbWireService (org.firebirdsql.gds.ng.wire.AbstractFbWireService)1 FbWireService (org.firebirdsql.gds.ng.wire.FbWireService)1 WireServiceConnection (org.firebirdsql.gds.ng.wire.WireServiceConnection)1