use of org.firebirdsql.gds.impl.GDSType in project jaybird by FirebirdSQL.
the class FBDriver method connect.
@Override
public FirebirdConnection connect(FirebirdConnectionProperties properties) throws SQLException {
GDSType type = GDSType.getType(properties.getType());
if (type == null) {
type = GDSFactory.getDefaultGDSType();
}
FBManagedConnectionFactory mcf = new FBManagedConnectionFactory(type, (FBConnectionProperties) properties).canonicalize();
FBDataSource dataSource = createDataSource(mcf);
return (FirebirdConnection) dataSource.getConnection(mcf.getUser(), mcf.getPassword());
}
use of org.firebirdsql.gds.impl.GDSType in project jaybird by FirebirdSQL.
the class FBXADataSource method initialize.
private void initialize() throws SQLException {
synchronized (lock) {
if (internalDs != null) {
return;
}
GDSType gdsType = GDSType.getType(getType());
if (gdsType == null) {
gdsType = GDSFactory.getDefaultGDSType();
}
FBManagedConnectionFactory mcf = new FBManagedConnectionFactory(gdsType, getConnectionProperties());
mcf.setDefaultConnectionManager(new XAConnectionManager());
internalDs = (FBDataSource) mcf.createConnectionFactory();
internalDs.setLogWriter(getLogWriter());
}
}
use of org.firebirdsql.gds.impl.GDSType in project jaybird by FirebirdSQL.
the class TestJaybirdBlobBackupProblem method setUp.
@Before
public void setUp() throws Exception {
GDSType gdsType = FBTestProperties.getGdsType();
dbFactory = FBTestProperties.getFbDatabaseFactory();
try {
fbManager = new FBManager(gdsType);
fbManager.setServer("localhost");
fbManager.setPort(5066);
fbManager.start();
File dbFolder = temporaryFolder.newFolder("db");
mAbsoluteBackupPath = new File(dbFolder, "testES01344.fbk").getAbsolutePath();
mAbsoluteDatabasePath = new File(dbFolder, "testES01344.fdb").getAbsolutePath();
fbManager.createDatabase(mAbsoluteDatabasePath, "SYSDBA", "masterkey");
} catch (Exception e) {
log.warn("exception in setup: ", e);
}
}
use of org.firebirdsql.gds.impl.GDSType in project jaybird by FirebirdSQL.
the class FBManager method setType.
@Override
public void setType(String type) {
final GDSType gdsType = GDSType.getType(type);
if (gdsType == null)
throw new RuntimeException("Unrecognized type '" + type + "'");
this.type = gdsType;
}
use of org.firebirdsql.gds.impl.GDSType in project jaybird by FirebirdSQL.
the class FBTestProperties method getDefaultSupportInfo.
/**
* The {@link org.firebirdsql.util.FirebirdSupportInfo} for the default test server.
*
* @return Support info object
*/
public static FirebirdSupportInfo getDefaultSupportInfo() {
try {
if (firebirdSupportInfo == null) {
final GDSType gdsType = getGdsType();
final FBServiceManager fbServiceManager = new FBServiceManager(gdsType);
if (gdsType == GDSType.getType("PURE_JAVA") || gdsType == GDSType.getType("NATIVE") || gdsType == GDSType.getType("OOREMOTE")) {
fbServiceManager.setServerName(DB_SERVER_URL);
fbServiceManager.setPortNumber(DB_SERVER_PORT);
}
fbServiceManager.setUser(FBTestProperties.DB_USER);
fbServiceManager.setPassword(FBTestProperties.DB_PASSWORD);
firebirdSupportInfo = FirebirdSupportInfo.supportInfoFor(fbServiceManager.getServerVersion());
}
return firebirdSupportInfo;
} catch (Exception e) {
throw new IllegalStateException("Cannot initialize support info", e);
}
}
Aggregations