org.geotools.data.geomedia
Class GeoMediaConnectionFactory

java.lang.Object
  extended byorg.geotools.data.geomedia.GeoMediaConnectionFactory

public class GeoMediaConnectionFactory
extends java.lang.Object

Title: GeoTools2 Development

Description:

Copyright: Copyright (c) 2003

Company:

Provides javax.sql.DataSource wrapper around a JDBC object. User passes a JDBC driver string as part of the properties. Driver is loaded using Class.forname() from the class path. User also passes a connection string URL as part of the properties.

Version:
1.0
Author:
Julian J. Ray

Constructor Summary
GeoMediaConnectionFactory(java.lang.String classname, java.lang.String poolKey, GeoMediaConnectionParam[] params)
          Creates a new Connection object.
 
Method Summary
 ConnectionPool getConnectionPool()
          Returns a connection from the connection pool.
 ConnectionPool getConnectionPool(java.lang.String user, java.lang.String pass)
          Creates the real Server Connection.
 void setLogin(java.lang.String user, java.lang.String pass)
          Sets the login credentials.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoMediaConnectionFactory

public GeoMediaConnectionFactory(java.lang.String classname,
                                 java.lang.String poolKey,
                                 GeoMediaConnectionParam[] params)
Creates a new Connection object.

Parameters:
classname - The host name of IP address to connect to.
poolKey - The port number on the host. Usually 1433
params - The database name on the host
Method Detail

getConnectionPool

public ConnectionPool getConnectionPool(java.lang.String user,
                                        java.lang.String pass)
                                 throws java.sql.SQLException
Creates the real Server Connection. Logs in to the Database and creates the Connection object. If the connection pool is not established, a new one is created.

Parameters:
user - The user name.
pass - The password
Returns:
The ConnectionPool object.
Throws:
java.sql.SQLException - If an error occurs connecting to the DB.

getConnectionPool

public ConnectionPool getConnectionPool()
                                 throws java.sql.SQLException
Returns a connection from the connection pool.

Returns:
The connection to the data base.
Throws:
java.sql.SQLException - If an error occurs.

setLogin

public void setLogin(java.lang.String user,
                     java.lang.String pass)
Sets the login credentials.

Parameters:
user - The username
pass - The password


Copyright © GeoTools. All Rights Reserved.