com.cloudera.sqoop.util
Class JdbcUrl

java.lang.Object
  extended by com.cloudera.sqoop.util.JdbcUrl

public final class JdbcUrl
extends java.lang.Object

Some utilities for parsing JDBC URLs which may not be tolerated by Java's java.net.URL class. java.net.URL does not support multi:part:scheme:// components, which virtually all JDBC connect string URLs have.


Field Summary
static org.apache.commons.logging.Log LOG
           
 
Method Summary
static java.lang.String getDatabaseName(java.lang.String connectString)
           
static java.lang.String getHostName(java.lang.String connectString)
           
static int getPort(java.lang.String connectString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
Method Detail

getDatabaseName

public static java.lang.String getDatabaseName(java.lang.String connectString)
Returns:
the database name from the connect string, which is typically the 'path' component, or null if we can't.

getHostName

public static java.lang.String getHostName(java.lang.String connectString)
Returns:
the hostname from the connect string, or null if we can't.

getPort

public static int getPort(java.lang.String connectString)
Returns:
the port from the connect string, or -1 if we can't.


Copyright © 2010 Cloudera, Inc.