org.dbmaintain.script.runner.impl.db2
Class Db2ConnectionInfo

java.lang.Object
  extended by org.dbmaintain.script.runner.impl.db2.Db2ConnectionInfo

public class Db2ConnectionInfo
extends Object


Field Summary
protected  String databaseName
           
protected static String DEFAULT_PORT
           
protected  String host
           
protected  String password
           
protected  String port
           
protected  String remoteAlias
           
protected  String userName
           
 
Constructor Summary
Db2ConnectionInfo(String databaseName, String userName, String password)
           
Db2ConnectionInfo(String host, String port, String databaseName, String remoteAlias, String userName, String password)
           
 
Method Summary
 String getDatabaseAlias()
           
 String getDatabaseName()
           
 String getHost()
           
 String getPassword()
           
 String getPort()
           
 String getUserName()
           
 boolean isRemote()
           
static Db2ConnectionInfo parseFromJdbcUrl(String jdbcUrl, String remoteAlias, String userName, String password)
           
protected static Db2ConnectionInfo parseFromType2JdbcUrl(String jdbcUrl, String userName, String password)
          A type 2 connection url has following structure: jdbc:db2:database
protected static Db2ConnectionInfo parseFromType4JdbcUrl(String jdbcUrl, String remoteAlias, String userName, String password)
          A type 4 connection url has following structure: jdbc:(db2)|(db:net)|(ids)://host(:port)/database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PORT

protected static String DEFAULT_PORT

host

protected String host

port

protected String port

databaseName

protected String databaseName

remoteAlias

protected String remoteAlias

userName

protected String userName

password

protected String password
Constructor Detail

Db2ConnectionInfo

public Db2ConnectionInfo(String databaseName,
                         String userName,
                         String password)

Db2ConnectionInfo

public Db2ConnectionInfo(String host,
                         String port,
                         String databaseName,
                         String remoteAlias,
                         String userName,
                         String password)
Method Detail

isRemote

public boolean isRemote()

getHost

public String getHost()

getPort

public String getPort()

getDatabaseName

public String getDatabaseName()

getDatabaseAlias

public String getDatabaseAlias()

getUserName

public String getUserName()

getPassword

public String getPassword()

parseFromJdbcUrl

public static Db2ConnectionInfo parseFromJdbcUrl(String jdbcUrl,
                                                 String remoteAlias,
                                                 String userName,
                                                 String password)

parseFromType4JdbcUrl

protected static Db2ConnectionInfo parseFromType4JdbcUrl(String jdbcUrl,
                                                         String remoteAlias,
                                                         String userName,
                                                         String password)
A type 4 connection url has following structure: jdbc:(db2)|(db:net)|(ids)://host(:port)/database

Parameters:
jdbcUrl - The url to parse, not null
remoteAlias - An alias for defining the remote connection, not null
userName - The user name, not null
password - The password, not null
Returns:
the connection info, not null

parseFromType2JdbcUrl

protected static Db2ConnectionInfo parseFromType2JdbcUrl(String jdbcUrl,
                                                         String userName,
                                                         String password)
A type 2 connection url has following structure: jdbc:db2:database

Parameters:
jdbcUrl - The url to parse, not null
userName - The user name, not null
password - The password, not null
Returns:
the connection info, not null


Copyright © 2011. All Rights Reserved.