org.mmbase.module.database
Class JDBC

java.lang.Object
  |
  +--org.mmbase.module.Module
        |
        +--org.mmbase.module.ProcessorModule
              |
              +--org.mmbase.module.database.JDBC
All Implemented Interfaces:
JDBCInterface, ProcessorInterface

public class JDBC
extends ProcessorModule
implements JDBCInterface

JDBC Module. The module that provides you access to the loaded JDBC interfaces. We use this as the base to get multiplexes/pooled JDBC connects.

Version:
$Id: JDBC.java,v 1.29.2.2 2003/03/16 17:47:02 michiel Exp $
Author:
vpro

Constructor Summary
JDBC()
           
 
Method Summary
 void checkTime()
           
 MultiConnection getConnection(java.lang.String url)
           
 MultiConnection getConnection(java.lang.String url, java.lang.String name, java.lang.String password)
           
 java.lang.String getDatabaseName()
           
 java.sql.Connection getDirectConnection(java.lang.String url)
           
 java.sql.Connection getDirectConnection(java.lang.String url, java.lang.String name, java.lang.String password)
           
 java.util.Vector getList(scanpage sp, StringTagger tagger, java.lang.String value)
          User interface stuff
 java.lang.String getPassword()
           
 java.lang.String getUser()
           
 void init()
          Initializes the module.
 java.util.Vector listConnections(StringTagger tagger)
           
 java.util.Vector listPools(StringTagger tagger)
           
 java.lang.String makeUrl()
          Routine build the url to give to the DriverManager to open the connection.
 java.lang.String makeUrl(java.lang.String dbm)
          Routine build the url to give to the DriverManager to open the connection.
 java.lang.String makeUrl(java.lang.String host, int port, java.lang.String dbm)
          Routine build the url to give to the DriverManager to open the connection.
 java.lang.String makeUrl(java.lang.String host, java.lang.String dbm)
          Routine build the url to give to the DriverManager to open the connection.
 void onload()
           
 void reload()
          Reload the properties and driver
 void shutdown()
          Shuts down the module.
 java.lang.String toString()
          Give some info about the jdbc connection
 void unload()
           
 
Methods inherited from class org.mmbase.module.ProcessorModule
cacheCheck, getListBuilder, getNodeList, process, replace, replace
 
Methods inherited from class org.mmbase.module.Module
getClassName, getInitParameter, getInitParameters, getMaintainer, getMimeType, getMimeTypeFile, getModule, getModule, getModuleInfo, getModules, getName, getProperties, getProperty, getVersion, hasStarted, loadModulesFromDisk, maintainance, setClassName, setInitParameter, setMaintainer, setName, setVersion, shutdownModules, startModule, startModules, state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JDBC

public JDBC()
Method Detail

onload

public void onload()
Overrides:
onload in class ProcessorModule

init

public void init()
Description copied from class: Module
Initializes the module. Init can be overridden to read the environment variables it needs.
This method is called by Module.startModule(), which makes sure it is not called more than once. You should not call init() directly, call startModule() instead.
Overrides:
init in class ProcessorModule

reload

public void reload()
Reload the properties and driver
Overrides:
reload in class ProcessorModule

unload

public void unload()
Overrides:
unload in class ProcessorModule

shutdown

public void shutdown()
Description copied from class: Module
Shuts down the module.
Overrides:
shutdown in class ProcessorModule

makeUrl

public java.lang.String makeUrl()
Routine build the url to give to the DriverManager to open the connection. This way a servlet/module doesn't need to care about what database it talks to.
Specified by:
makeUrl in interface JDBCInterface
See Also:
DriverManager.getConnection(java.lang.String)

makeUrl

public java.lang.String makeUrl(java.lang.String dbm)
Routine build the url to give to the DriverManager to open the connection. This way a servlet/module doesn't need to care about what database it talks to.
Specified by:
makeUrl in interface JDBCInterface
See Also:
DriverManager.getConnection(java.lang.String)

makeUrl

public java.lang.String makeUrl(java.lang.String host,
                                java.lang.String dbm)
Routine build the url to give to the DriverManager to open the connection. This way a servlet/module doesn't need to care about what database it talks to.
Specified by:
makeUrl in interface JDBCInterface
See Also:
DriverManager.getConnection(java.lang.String)

makeUrl

public java.lang.String makeUrl(java.lang.String host,
                                int port,
                                java.lang.String dbm)
Routine build the url to give to the DriverManager to open the connection. This way a servlet/module doesn't need to care about what database it talks to.
Specified by:
makeUrl in interface JDBCInterface
See Also:
DriverManager.getConnection(java.lang.String)

getConnection

public MultiConnection getConnection(java.lang.String url,
                                     java.lang.String name,
                                     java.lang.String password)
                              throws java.sql.SQLException
Specified by:
getConnection in interface JDBCInterface

getConnection

public MultiConnection getConnection(java.lang.String url)
                              throws java.sql.SQLException
Specified by:
getConnection in interface JDBCInterface

getDirectConnection

public java.sql.Connection getDirectConnection(java.lang.String url,
                                               java.lang.String name,
                                               java.lang.String password)
                                        throws java.sql.SQLException
Specified by:
getDirectConnection in interface JDBCInterface

getDirectConnection

public java.sql.Connection getDirectConnection(java.lang.String url)
                                        throws java.sql.SQLException
Specified by:
getDirectConnection in interface JDBCInterface

checkTime

public void checkTime()
Specified by:
checkTime in interface JDBCInterface

getList

public java.util.Vector getList(scanpage sp,
                                StringTagger tagger,
                                java.lang.String value)
                         throws ParseException
User interface stuff
Overrides:
getList in class ProcessorModule
Following copied from class: org.mmbase.module.ProcessorModule
Parameters:
sp - the page context
params - contains the attributes for the list
command - the list command to execute.

listPools

public java.util.Vector listPools(StringTagger tagger)

listConnections

public java.util.Vector listConnections(StringTagger tagger)

getUser

public java.lang.String getUser()
Specified by:
getUser in interface JDBCInterface

getPassword

public java.lang.String getPassword()
Specified by:
getPassword in interface JDBCInterface

getDatabaseName

public java.lang.String getDatabaseName()
Specified by:
getDatabaseName in interface JDBCInterface

toString

public java.lang.String toString()
Give some info about the jdbc connection
Overrides:
toString in class java.lang.Object
Returns:
a String whith some information about the connection


MMBase build 1.6.5.20030923