public class ConnectionSpecification
extends java.lang.Object
ConnectionHolder
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
ACCESS_DRIVER |
static boolean |
autoCommitStandard
Caution: Deadlocks occurred in MS SQL Server with auto-commit off!
|
static int |
CONNECT_JDBC_DIRECT |
static int |
CONNECT_JDBC_ODBC_BY_DSN |
static int |
CONNECT_JDBC_ODBC_BY_FILE_PATH |
Constructor and Description |
---|
ConnectionSpecification(java.io.File dbFile) |
ConnectionSpecification(java.io.File dbFile,
java.lang.String userName,
java.lang.String password) |
ConnectionSpecification(java.lang.String odbcName)
Constructs a connection specification for a ODBC connection with blank user
and password.
|
ConnectionSpecification(java.lang.String odbcName,
java.lang.String userName,
java.lang.String password)
Constructs a connection specification for a ODBC connection.
|
ConnectionSpecification(java.lang.String url,
java.lang.String driverName,
java.lang.String userName,
java.lang.String password)
Constructs a connection specification for a direct JDBC connection.
|
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
getConnection()
Returns a connection as specified when constructed.
|
int |
getConnectType()
Returns the connect type
|
java.lang.String |
getDriverName()
Returns the driver's name
|
java.lang.String |
getOdbcName()
Returns the ODBC data source name name
|
java.lang.String |
getPassword()
Returns the password of the database user
|
java.lang.String |
getUrl()
Returns the URL
|
java.lang.String |
getUserName()
Returns the name of the database user
|
void |
setDbCharset(java.lang.String dbCharset)
Sets the database character set, e.g.
|
java.lang.String |
toString() |
public static final java.lang.String[] ACCESS_DRIVER
public static final int CONNECT_JDBC_ODBC_BY_DSN
public static final int CONNECT_JDBC_DIRECT
public static final int CONNECT_JDBC_ODBC_BY_FILE_PATH
public static boolean autoCommitStandard
public ConnectionSpecification(java.lang.String odbcName)
odbcName
- the ODBC data source name namepublic ConnectionSpecification(java.lang.String odbcName, java.lang.String userName, java.lang.String password)
odbcName
- the ODBC data source nameuserName
- the name of the database userpassword
- the password of the database userpublic ConnectionSpecification(java.lang.String url, java.lang.String driverName, java.lang.String userName, java.lang.String password)
url
- the URL of the database to connect todriverName
- the name of the database drive to useuserName
- the name of the database userpassword
- the password of the database userpublic ConnectionSpecification(java.io.File dbFile)
public ConnectionSpecification(java.io.File dbFile, java.lang.String userName, java.lang.String password)
public void setDbCharset(java.lang.String dbCharset)
dbCharset
- the database character set to usepublic int getConnectType()
public java.lang.String getOdbcName()
public java.lang.String getUrl()
public java.lang.String getDriverName()
public java.lang.String getUserName()
public java.lang.String getPassword()
public java.sql.Connection getConnection() throws java.lang.ClassNotFoundException, java.sql.SQLException
java.lang.ClassNotFoundException
java.sql.SQLException
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de