Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jeteam.mbean
Class InitialLoad  view InitialLoad download InitialLoad.java

java.lang.Object
  extended byorg.jeteam.mbean.InitialLoad
All Implemented Interfaces:
InitialLoadMBean

public class InitialLoad
extends java.lang.Object
implements InitialLoadMBean

This class loads the initial-load.sql queries and updates the data-source bound to jeteamDS.

All lines in this script, that start with the '#' character are being ignored.

The default data-source is "java:/jeteamDS", the script file name is "initial-load.sql", the comment delimiter for that script is the '#' character.


Field Summary
private  java.lang.String dataSourceName
           
private  java.lang.String scriptCommentDelimiter
           
private  java.lang.String scriptFileName
           
 
Constructor Summary
InitialLoad()
           
 
Method Summary
private  void batchUpdate(java.sql.Connection connection, java.io.BufferedReader reader)
          Updates the data-source with all queries in one batch operation.
 java.lang.String getDataSourceName()
           
 void setDataSourceName(java.lang.String dataSourceName)
           
private  void singleUpdates(java.sql.Connection connection, java.io.BufferedReader reader)
          Updates the data-source with a single query at a time, doing a call for each line in the script that is not comment.
 void uploadInitialLoad()
          Uploads the initial-load.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataSourceName

private java.lang.String dataSourceName

scriptFileName

private final java.lang.String scriptFileName
See Also:
Constant Field Values

scriptCommentDelimiter

private final java.lang.String scriptCommentDelimiter
See Also:
Constant Field Values
Constructor Detail

InitialLoad

public InitialLoad()
Method Detail

getDataSourceName

public java.lang.String getDataSourceName()
Specified by:
getDataSourceName in interface InitialLoadMBean

setDataSourceName

public void setDataSourceName(java.lang.String dataSourceName)
Specified by:
setDataSourceName in interface InitialLoadMBean

batchUpdate

private final void batchUpdate(java.sql.Connection connection,
                               java.io.BufferedReader reader)
                        throws java.lang.Exception
Updates the data-source with all queries in one batch operation.


singleUpdates

private final void singleUpdates(java.sql.Connection connection,
                                 java.io.BufferedReader reader)
                          throws java.lang.Exception
Updates the data-source with a single query at a time, doing a call for each line in the script that is not comment.


uploadInitialLoad

public void uploadInitialLoad()
Uploads the initial-load.

Specified by:
uploadInitialLoad in interface InitialLoadMBean