org.millscript.millscript.datatypes
Class DatabaseSource

java.lang.Object
  extended by org.millscript.millscript.datatypes.DatabaseSource

public class DatabaseSource
extends java.lang.Object

This class is a wrapper for a DataSource. It allows millscript to share a database connection between multiple functions, as created by the SQL loader.

Since:
9.6.4

Constructor Summary
DatabaseSource(java.lang.String n, javax.sql.DataSource ds, java.io.File lf)
          Constructs a new DatabaseSource using the supplied DataSource.
 
Method Summary
 java.sql.Connection getConnection()
          Returns a connection to the database detailed in this DataSource.
 java.lang.String toString()
          Returns a string representation of this database source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatabaseSource

public DatabaseSource(java.lang.String n,
                      javax.sql.DataSource ds,
                      java.io.File lf)
Constructs a new DatabaseSource using the supplied DataSource.

Parameters:
n - the DataSource name
ds - the DataSource to wrap.
lf - the DataSource lockfile, or null if there is no lockfile
Method Detail

getConnection

public java.sql.Connection getConnection()
Returns a connection to the database detailed in this DataSource.

Returns:
the connection to the database

toString

public java.lang.String toString()
Returns a string representation of this database source.

Overrides:
toString in class java.lang.Object
Returns:
a string representing this database source


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.