Search in sources :

Example 1 with FbConnectionProperties

use of org.firebirdsql.gds.ng.FbConnectionProperties in project jaybird by FirebirdSQL.

the class FBManager method createDefaultConnectionProperties.

private IConnectionProperties createDefaultConnectionProperties(String user, String password) {
    FbConnectionProperties connectionProperties = new FbConnectionProperties();
    connectionProperties.setUser(user);
    connectionProperties.setPassword(password);
    connectionProperties.setServerName(getServer());
    connectionProperties.setPortNumber(getPort());
    return connectionProperties;
}
Also used : FbConnectionProperties(org.firebirdsql.gds.ng.FbConnectionProperties)

Example 2 with FbConnectionProperties

use of org.firebirdsql.gds.ng.FbConnectionProperties in project jaybird by FirebirdSQL.

the class TestFBConnectionTimeout method buildTestURL.

/**
 * Builds the test URL (to a non-existent IP) for the current GDS testtype.
 *
 * @return Test URL to a non-existent IP
 */
private static String buildTestURL() {
    GDSType gdsType = FBTestProperties.getGdsType();
    FbConnectionProperties properties = new FbConnectionProperties();
    properties.setServerName(NON_EXISTENT_IP);
    properties.setDatabaseName("db");
    try {
        return GDSFactory.getJdbcUrl(gdsType, properties);
    } catch (SQLException e) {
        fail("Unable to generate testURL");
    }
    return null;
}
Also used : SQLException(java.sql.SQLException) FbConnectionProperties(org.firebirdsql.gds.ng.FbConnectionProperties) GDSType(org.firebirdsql.gds.impl.GDSType)

Aggregations

FbConnectionProperties (org.firebirdsql.gds.ng.FbConnectionProperties)2 SQLException (java.sql.SQLException)1 GDSType (org.firebirdsql.gds.impl.GDSType)1