Package de.suse.lib.sqlmap.drivers
Class PgSQLDriver
- java.lang.Object
-
- de.suse.lib.sqlmap.drivers.GenericDriver
-
- de.suse.lib.sqlmap.drivers.PgSQLDriver
-
- All Implemented Interfaces:
DBConnectionDriver
public class PgSQLDriver extends GenericDriver
-
-
Field Summary
-
Fields inherited from class de.suse.lib.sqlmap.drivers.GenericDriver
callback, connection
-
-
Constructor Summary
Constructors Constructor Description PgSQLDriver(java.lang.String url)Create a driver to an URL connection.PgSQLDriver(java.sql.Connection conn)Create a driver out of the connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PgSQLDriverconnect(java.lang.String user, java.lang.String password)Connect to the PostgreSQL database with already given URL.java.sql.ConnectiongetConnection()protected voidparseURL()Parse URL for connect.PgSQLDriversetUseSSL(boolean useSSL)Use SSL connection?-
Methods inherited from class de.suse.lib.sqlmap.drivers.GenericDriver
close, getDatabase, getHost, getPort, getUrl, isConnected, setConnectionCallback, setDatabase, setHost, setPort
-
-
-
-
Constructor Detail
-
PgSQLDriver
public PgSQLDriver(java.lang.String url) throws java.net.URISyntaxException, java.lang.ClassNotFoundException, java.sql.SQLException, java.lang.ExceptionCreate a driver to an URL connection.- Parameters:
url-- Throws:
java.net.URISyntaxExceptionjava.lang.ClassNotFoundExceptionjava.sql.SQLExceptionjava.lang.Exception
-
PgSQLDriver
public PgSQLDriver(java.sql.Connection conn)
Create a driver out of the connection.- Parameters:
conn-
-
-
Method Detail
-
parseURL
protected void parseURL() throws java.sql.SQLExceptionDescription copied from class:GenericDriverParse URL for connect.- Overrides:
parseURLin classGenericDriver- Throws:
java.sql.SQLException
-
setUseSSL
public PgSQLDriver setUseSSL(boolean useSSL)
Use SSL connection?- Parameters:
useSSL-
-
connect
public PgSQLDriver connect(java.lang.String user, java.lang.String password) throws java.lang.Exception
Connect to the PostgreSQL database with already given URL.- Specified by:
connectin interfaceDBConnectionDriver- Overrides:
connectin classGenericDriver- Parameters:
user-password-- Returns:
- Throws:
java.lang.Exception
-
getConnection
public java.sql.Connection getConnection()
- Specified by:
getConnectionin interfaceDBConnectionDriver- Overrides:
getConnectionin classGenericDriver
-
-