Package dev.array21.jdbd.drivers
Class PostgreSqlDriver
java.lang.Object
dev.array21.jdbd.drivers.PostgreSqlDriver
- All Implemented Interfaces:
DatabaseDriver
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPostgreSqlDriver(String host, String username, String password, String database) Create a new PostgreSQL -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(PreparedStatement statement) booleanisLoaded()Check if the driver is loaded.voidLoad the native driverSqlRow[]query(PreparedStatement statement) voidunload()
-
Constructor Details
-
PostgreSqlDriver
Create a new PostgreSQLThread Safety
It is up to the implementer to guarantee that this method is NOT called from two threads simultaneously, this can result in Undefined Behaviour- Parameters:
host- The PostgreSQL hostusername- The PostgreSQL usernamepassword- The PostgreSQL passworddatabase- The PostgreSQL database
-
-
Method Details
-
loadDriver
Load the native driver- Throws:
IOException- When saving the native library failedUnsatisfiedLinkError- When loading the native library failedUnsupportedOperatingSystemException- When the current operating system is unsupportedRuntimeException- WheninitializeNative()returns an error
-
isLoaded
public boolean isLoaded()Check if the driver is loaded. When:- The library is loaded
- The driver has been initialized
- Returns:
- True if it is loaded, false otherwhise
-
query
- Specified by:
queryin interfaceDatabaseDriver- Throws:
SqlException
-
execute
- Specified by:
executein interfaceDatabaseDriver- Throws:
SqlException
-
unload
public void unload()- Specified by:
unloadin interfaceDatabaseDriver
-