Class TeamCityJdbcDrivers
- java.lang.Object
-
- jetbrains.buildServer.serverSide.db.jdbcLoader.TeamCityJdbcDrivers
-
- All Implemented Interfaces:
JdbcDrivers
public class TeamCityJdbcDrivers extends Object implements JdbcDrivers
Loaded JDBC drivers. Holds a list of explicitly loaded JDBC drivers, and can provide one by conenction URL or connection URL and concrete class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfinalize()DriverfindDefaultDriver(DatabaseType dbType)Provides with the default driver for the specified database type.DriverfindDriver(String connectionString)Looks for a situable driver (one that accepts the given url, seeDriver.acceptsURL(String)).ClassLoadergetClassLoader()The classloader provided via constructor.DrivergetDriver(String connectionString)Looks for a situable driver (one that accepts the given url, seeDriver.acceptsURL(String)).DrivergetDriver(String connectionString, String className)Looks for the specified JDBC driver, checks the given URL and returns this driver if all OK.FilegetDriverLocation(Driver driver)Returns location of jar file containing specified JDBC driver.Collection<Driver>getDrivers()voidunregisterAll()Check whether there is a JDBC driver suitable for the given URL.
-
-
-
Method Detail
-
getClassLoader
@NotNull public ClassLoader getClassLoader()
The classloader provided via constructor.- Specified by:
getClassLoaderin interfaceJdbcDrivers- Returns:
- class loader.
-
findDefaultDriver
@Nullable public Driver findDefaultDriver(@NotNull DatabaseType dbType)
Provides with the default driver for the specified database type.- Specified by:
findDefaultDriverin interfaceJdbcDrivers- Parameters:
dbType- type of the database.- Returns:
- the driver, or null if no applicable drivers.
-
getDriver
@NotNull public Driver getDriver(@NotNull String connectionString) throws NoSuitableJdbcDrivers
Looks for a situable driver (one that accepts the given url, seeDriver.acceptsURL(String)). Or raises an exception if no suitable drivers.- Specified by:
getDriverin interfaceJdbcDrivers- Parameters:
connectionString- url to check for.- Returns:
- found suitable driver.
- Throws:
NoSuitableJdbcDrivers- when no suitable JDBC drivers found.
-
findDriver
@Nullable public Driver findDriver(@NotNull String connectionString)
Looks for a situable driver (one that accepts the given url, seeDriver.acceptsURL(String)).- Specified by:
findDriverin interfaceJdbcDrivers- Parameters:
connectionString- url to check for.- Returns:
- found suitable driver, or null if not found.
-
getDriver
@NotNull public Driver getDriver(@NotNull String connectionString, @NotNull String className) throws NoSuitableJdbcDrivers
Looks for the specified JDBC driver, checks the given URL and returns this driver if all OK.- Specified by:
getDriverin interfaceJdbcDrivers- Parameters:
connectionString- url to check for.className- driver class name.- Returns:
- found suitable driver.
- Throws:
NoSuitableJdbcDrivers- when no such class found or the specified driver doesn't accept the given URL.
-
unregisterAll
public void unregisterAll()
Check whether there is a JDBC driver suitable for the given URL.- Specified by:
unregisterAllin interfaceJdbcDrivers- Parameters:
url- url to check for.- See Also:
getDriver(String)
-
getDriverLocation
@Nullable public File getDriverLocation(@NotNull Driver driver)
Description copied from interface:JdbcDriversReturns location of jar file containing specified JDBC driver.- Specified by:
getDriverLocationin interfaceJdbcDrivers- Returns:
- location of jar file on disk, or null if location cannot be determined for some reason.
-
getDrivers
@NotNull public Collection<Driver> getDrivers()
-
-