@Immutable public final class DriverManagerDestination extends java.lang.Object implements Destination
DriverManager
to get a connectionConstructor and Description |
---|
DriverManagerDestination(java.lang.String url,
java.lang.String user,
java.lang.String password)
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 DriverManagerDestination |
with(java.lang.String url,
java.lang.String user,
java.lang.String password)
Factory method creating a new DriverManagerDestination.
|
public DriverManagerDestination(@Nonnull java.lang.String url, java.lang.String user, java.lang.String password)
url
- the URL of the databaseuser
- the user used to get a connectionpassword
- the password used to get a connectionpublic static DriverManagerDestination with(@Nonnull java.lang.String url, java.lang.String user, java.lang.String password)
DbSetup dbSetup = new DbSetup(DriverManagerDestination.with(url, user, password), operation);or, if this method is statically imported:
DbSetup dbSetup = new DbSetup(with(url, user, password), operation);instead of
DbSetup dbSetup = new DbSetup(new DriverManagerDestination(url, user, password), operation);
url
- the URL of the databaseuser
- the user used to get a connectionpassword
- the password used to get a connectionpublic 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