org.mmbase.module.database
Class JDBC

java.lang.Object
  extended byorg.mmbase.util.functions.FunctionProvider
      extended byorg.mmbase.module.Module
          extended byorg.mmbase.module.ProcessorModule
              extended byorg.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.47 2006/06/20 20:50:47 michiel Exp $
Author:
vpro

Nested Class Summary
 
Nested classes inherited from class org.mmbase.module.ProcessorModule
ProcessorModule.GetNodeListFunction, ProcessorModule.ProcessFunction, ProcessorModule.ReplaceFunction
 
Field Summary
 
Fields inherited from class org.mmbase.module.ProcessorModule
PARAM_PAGEINFO, PARAMS_PAGEINFO
 
Fields inherited from class org.mmbase.module.Module
getMaintainerFunction, getVersionFunction
 
Fields inherited from class org.mmbase.util.functions.FunctionProvider
functions, getFunctions
 
Constructor Summary
JDBC()
           
 
Method Summary
 void checkTime()
           
 MultiConnection getConnection(String url)
           
 MultiConnection getConnection(String url, String name, String password)
           
 String getDatabaseName()
           
 Connection getDirectConnection(String url)
           
 Connection getDirectConnection(String url, String name, String password)
           
 Vector getList(PageInfo sp, StringTagger tagger, String value)
          User interface stuff
 String getPassword()
           
 String getUser()
           
 void init()
          Initializes the module. Init must 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.
 Vector listConnections(StringTagger tagger)
           
 Vector listPools(StringTagger tagger)
           
 String makeUrl()
          Routine build the url to give to the DriverManager to open the connection.
 String makeUrl(String dbm)
          Routine build the url to give to the DriverManager to open the connection.
 String makeUrl(String host, int port, String dbm)
          Routine build the url to give to the DriverManager to open the connection.
 String makeUrl(String host, String dbm)
          Routine build the url to give to the DriverManager to open the connection.
 void onload()
          prepares the module when loaded. Onload must be overridden to execute methods that need to be performed when the module is loaded but before any other modules are initailized.
This method is called by Module.startModules(). You should not call onload() directly.
 void reload()
          What should this do, when is this called? Reload the properties and driver
protected  void shutdown()
          Shuts down the module.
 String toString()
          Give some info about the jdbc connection
 void unload()
          What should this do, when is this called?
 
Methods inherited from class org.mmbase.module.ProcessorModule
cacheCheck, getListBuilder, getNodeList, process, replace, replace
 
Methods inherited from class org.mmbase.module.Module
getInitParameter, getInitParameters, getMaintainer, getModule, getModule, getModuleInfo, getModuleLoader, getModuleReader, getModules, getName, getProperties, getProperty, getVersion, hasStarted, maintainance, setInitParameter, setMaintainer, setName, setVersion, shutdownModules, startModule, startModules, state
 
Methods inherited from class org.mmbase.util.functions.FunctionProvider
addFunction, createParameters, getFunction, getFunctions, getFunctionValue, newFunctionInstance
 
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()
Description copied from class: ProcessorModule
prepares the module when loaded. Onload must be overridden to execute methods that need to be performed when the module is loaded but before any other modules are initailized.
This method is called by Module.startModules(). You should not call onload() directly.

Overrides:
onload in class ProcessorModule

init

public void init()
Description copied from class: ProcessorModule
Initializes the module. Init must 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()
What should this do, when is this called? Reload the properties and driver

Overrides:
reload in class ProcessorModule

unload

public void unload()
Description copied from class: ProcessorModule
What should this do, when is this called?

Overrides:
unload in class ProcessorModule

shutdown

protected void shutdown()
Description copied from class: Module
Shuts down the module. This method is called by shutdownModules.

Overrides:
shutdown in class Module

makeUrl

public 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 String makeUrl(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 String makeUrl(String host,
                      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 String makeUrl(String host,
                      int port,
                      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(String url,
                                     String name,
                                     String password)
                              throws SQLException
Specified by:
getConnection in interface JDBCInterface
Throws:
SQLException
Warning: No Java Documentation Available.

getConnection

public MultiConnection getConnection(String url)
                              throws SQLException
Specified by:
getConnection in interface JDBCInterface
Throws:
SQLException
Warning: No Java Documentation Available.

getDirectConnection

public Connection getDirectConnection(String url,
                                      String name,
                                      String password)
                               throws SQLException
Specified by:
getDirectConnection in interface JDBCInterface
Throws:
SQLException
Warning: No Java Documentation Available.

getDirectConnection

public Connection getDirectConnection(String url)
                               throws SQLException
Specified by:
getDirectConnection in interface JDBCInterface
Throws:
SQLException
Warning: No Java Documentation Available.

checkTime

public void checkTime()
Specified by:
checkTime in interface JDBCInterface
Warning: No Java Documentation Available.

getList

public Vector getList(PageInfo sp,
                      StringTagger tagger,
                      String value)
User interface stuff

Specified by:
getList in interface ProcessorInterface
Overrides:
getList in class ProcessorModule
Warning: No Java Documentation Available.

listPools

public Vector listPools(StringTagger tagger)
Warning: No Java Documentation Available.

listConnections

public Vector listConnections(StringTagger tagger)
Warning: No Java Documentation Available.

getUser

public String getUser()
Specified by:
getUser in interface JDBCInterface
Warning: No Java Documentation Available.

getPassword

public String getPassword()
Specified by:
getPassword in interface JDBCInterface
Warning: No Java Documentation Available.

getDatabaseName

public String getDatabaseName()
Specified by:
getDatabaseName in interface JDBCInterface
Warning: No Java Documentation Available.

toString

public String toString()
Give some info about the jdbc connection

Returns:
a String whith some information about the connection


MMBase build 1.8.1.20060716