@Immutable public final class DataSourceDestination extends java.lang.Object implements Destination
Constructor and Description |
---|
DataSourceDestination(javax.sql.DataSource dataSource)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.sql.Connection |
getConnection()
Returns a connection to the destination database
|
int |
hashCode() |
java.lang.String |
toString() |
static DataSourceDestination |
with(javax.sql.DataSource dataSource)
Factory method creating a new DataSourceDestination.
|
public DataSourceDestination(@Nonnull javax.sql.DataSource dataSource)
dataSource
- the wrapped DataSourcepublic static DataSourceDestination with(@Nonnull javax.sql.DataSource dataSource)
DbSetup dbSetup = new DbSetup(DataSourceDestination.with(dataSource), operation);or, if this method is statically imported:
DbSetup dbSetup = new DbSetup(with(dataSource), operation);instead of
DbSetup dbSetup = new DbSetup(new DataSourceDestination(dataSource), operation);
dataSource
- the wrapped DataSourcepublic java.sql.Connection getConnection() throws java.sql.SQLException
Destination
getConnection
in interface Destination
java.sql.SQLException
- if a connection can't be returnedpublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object