@Deprecated
public class SshDataSource
extends org.apache.commons.dbcp.BasicDataSource
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MSSQL
Deprecated.
|
static java.lang.String |
MYSQL
Deprecated.
|
static java.lang.String |
ORACLE
Deprecated.
|
static java.lang.String |
POSTGRESQL
Deprecated.
|
java.lang.String |
remoteUrl
Deprecated.
|
connectionPool, connectionProperties, dataSource, defaultAutoCommit, defaultCatalog, defaultReadOnly, defaultTransactionIsolation, driverClassName, initialSize, logWriter, maxActive, maxIdle, maxOpenPreparedStatements, maxWait, minEvictableIdleTimeMillis, minIdle, numTestsPerEvictionRun, password, poolPreparedStatements, testOnBorrow, testOnReturn, testWhileIdle, timeBetweenEvictionRunsMillis, url, username, validationQuery
Constructor and Description |
---|
SshDataSource(java.lang.String sshUser,
java.io.File key)
Deprecated.
Default using ssh port 22
|
SshDataSource(java.lang.String sshUser,
int sshPort,
java.io.File key)
Deprecated.
Creates a BasicDataSource that uses an ssh tunnel to connect to the database
|
SshDataSource(java.lang.String sshUser,
int sshPort,
java.lang.String password)
Deprecated.
Creates a BasicDataSource that uses an ssh tunnel to connect to the database
|
SshDataSource(java.lang.String sshUser,
java.lang.String password)
Deprecated.
Default using ssh port 22
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Deprecated.
|
static int |
getFreePort()
Deprecated.
Returns a free port on the machine
|
java.util.logging.Logger |
getParentLogger()
Deprecated.
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
Deprecated.
|
void |
setRemoteUrl(java.lang.String url)
Deprecated.
Sets the remote url you wish to connect to
|
void |
setUrl(java.lang.String url)
Deprecated.
|
void |
setUrl(java.lang.String sqlDatabaseType,
int sqlServerPort,
java.lang.String databaseName)
Deprecated.
Use this instead of setUrl(String url).
|
<T> T |
unwrap(java.lang.Class<T> iface)
Deprecated.
|
addConnectionProperty, createDataSource, getConnection, getConnection, getDefaultAutoCommit, getDefaultCatalog, getDefaultReadOnly, getDefaultTransactionIsolation, getDriverClassName, getInitialSize, getLogAbandoned, getLoginTimeout, getLogWriter, getMaxActive, getMaxIdle, getMaxOpenPreparedStatements, getMaxWait, getMinEvictableIdleTimeMillis, getMinIdle, getNumActive, getNumIdle, getNumTestsPerEvictionRun, getPassword, getRemoveAbandoned, getRemoveAbandonedTimeout, getTestOnBorrow, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRunsMillis, getUrl, getUsername, getValidationQuery, isAccessToUnderlyingConnectionAllowed, isPoolPreparedStatements, removeConnectionProperty, setAccessToUnderlyingConnectionAllowed, setDefaultAutoCommit, setDefaultCatalog, setDefaultReadOnly, setDefaultTransactionIsolation, setDriverClassName, setInitialSize, setLogAbandoned, setLoginTimeout, setLogWriter, setMaxActive, setMaxIdle, setMaxOpenPreparedStatements, setMaxWait, setMinEvictableIdleTimeMillis, setMinIdle, setNumTestsPerEvictionRun, setPassword, setPoolPreparedStatements, setRemoveAbandoned, setRemoveAbandonedTimeout, setTestOnBorrow, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRunsMillis, setUsername, setValidationQuery
public static final java.lang.String MYSQL
public static final java.lang.String MSSQL
public static final java.lang.String ORACLE
public static final java.lang.String POSTGRESQL
public java.lang.String remoteUrl
public SshDataSource(@NotNull java.lang.String sshUser, @NotNull java.lang.String password)
sshUser
- Ex: user@remotehost.compassword
- The passwordpublic SshDataSource(@NotNull java.lang.String sshUser, int sshPort, @NotNull java.lang.String password)
sshUser
- The usernamesshPort
- The portpassword
- The passwordpublic SshDataSource(@NotNull java.lang.String sshUser, @NotNull java.io.File key) throws java.io.FileNotFoundException
sshUser
- Ex: user@remotehost.comkey
- The key file for accessjava.io.FileNotFoundException
- If the key file isn't foundpublic SshDataSource(@NotNull java.lang.String sshUser, int sshPort, @NotNull java.io.File key) throws java.io.FileNotFoundException
sshUser
- The usernamesshPort
- The portkey
- The key file for accessjava.io.FileNotFoundException
- If the key file isn't foundpublic void close() throws java.sql.SQLException
close
in class org.apache.commons.dbcp.BasicDataSource
java.sql.SQLException
public void setUrl(@NotNull java.lang.String sqlDatabaseType, int sqlServerPort, @Nullable java.lang.String databaseName)
sqlDatabaseType
- SshDataSource.MYSQL, SshDataSource.MSSQL, SshDataSource.ORACLE, or SshDataSource.POSTRESQLsqlServerPort
- listening port of remote sql serverdatabaseName
- name of the database you want to connect to or nullpublic void setRemoteUrl(java.lang.String url)
url
- default localhostpublic void setUrl(java.lang.String url)
setUrl
in class org.apache.commons.dbcp.BasicDataSource
public static int getFreePort()
@NotNull public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
java.sql.SQLException
@NotNull public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
java.sql.SQLFeatureNotSupportedException