SQLTuple version: 1.2.0.0

hep.aida.ref.sql
Class AidaSQLStore

java.lang.Object
  extended by hep.aida.ref.sql.AidaSQLStore
All Implemented Interfaces:
IStore

public class AidaSQLStore
extends Object
implements IStore

AidaSQLStore implements IStore with support for SQLTuples. Created ITree has a flat structure, it contains just ITuples corresponding to SQL table names.

 $Log: AidaSQLStore.java,v $
 Revision 1.46  2007/06/11 14:02:29  hrivnac
 better support for tags in Oracle

 Revision 1.45  2007/05/23 16:38:43  hrivnac
 logical connections for Plotter; better UML

 Revision 1.44  2006/12/12 15:21:42  hrivnac
 McKoi replaced with Derby; uppercase-only dbs handled better; moving to JAS 0.8.3

 Revision 1.43  2006/11/20 13:51:59  hrivnac
 Connection is closed except within JAS3

 Revision 1.42  2006/11/15 16:16:01  hrivnac
 Oracle work fine in CERN, cache enabled

 Revision 1.41  2006/11/10 17:40:03  hrivnac
 WebService updated, long-format Oracle URL allowed, complete db not parsed if only table requested (speed)

 Revision 1.40  2005/09/28 16:21:06  hrivnac
 code cleaning

 Revision 1.39  2005/01/25 16:45:03  hrivnac
 Adding rows uses PreparedStatement

 Revision 1.38  2004/12/07 01:04:56  hrivnac
 name pattern can be specified

 Revision 1.37  2004/12/02 15:44:54  hrivnac
 fixes for ColMan JAS3 plugin

 Revision 1.36  2004/11/24 14:32:32  hrivnac
 better support for schemas

 Revision 1.35  2004/11/22 18:09:52  hrivnac
 Oracle treatment

 Revision 1.34  2004/11/05 10:59:19  hrivnac
 Doc fix

 Revision 1.33  2004/10/29 22:27:25  hrivnac
 imports corrected

 Revision 1.32  2004/10/28 15:25:40  hrivnac
 *** empty log message ***

 Revision 1.31  2004/10/12 13:25:40  hrivnac
 small improvements

 Revision 1.30  2004/10/08 15:22:33  hrivnac
 JAS3 plugin works

 Revision 1.29  2004/09/02 12:16:37  hrivnac
 Filter works correctly between different dbs

 Revision 1.28  2004/07/06 14:24:50  hrivnac
 support for Oracle

 Revision 1.27  2004/06/23 08:04:53  hrivnac
 documentation fixes

 Revision 1.26  2004/05/22 15:12:59  hrivnac
 class id reformated

 Revision 1.25  2004/05/03 19:22:30  hrivnac
 basic support for JAS3

 Revision 1.24  2004/04/14 13:39:46  hrivnac
 1.5 warnings fixed

 Revision 1.23  2004/04/13 15:45:54  hrivnac
 AIDA URL introduced

 Revision 1.22  2004/02/12 16:39:40  hrivnac
 niceing

 Revision 1.21  2004/02/10 14:50:58  hrivnac
 JavaDoc tags completed

 Revision 1.20  2003/11/26 16:09:46  hrivnac
 Functional EventSelector WebService

 Revision 1.19  2003/11/24 15:13:21  hrivnac
 Logging improved.

 Revision 1.18  2003/11/20 17:21:57  hrivnac
 Java 1.5 natively supported, Log4J reporting improved.

 Revision 1.17  2003/11/17 10:18:28  hrivnac
 Cleaning.

 Revision 1.16  2003/11/05 19:46:22  hrivnac
 - FreeHEP 1.2.1
 - JAIDA 3.2.1

 Revision 1.9  2003/10/21 13:24:51  hrivnac
 Constructor from columnString implemented.

 

Version:
$Id: AidaSQLStore.java,v 1.46 2007/06/11 14:02:29 hrivnac Exp $
Author:
J.Hrivnac

Field Summary
private  Accessor _accessor
           
private static Logger log
          Logging .
 
Constructor Summary
AidaSQLStore()
           
 
Method Summary
private  Accessor accessor(Map optionsMap)
          Get Accessor: If there is one already associated one, use it.
 void close()
          Disconnect from DB (if not running as JAS3 plugin).
 void commit(IDevTree tree, Map optionsMap)
          Commit all tables of the Tree.
 boolean isReadOnly()
          SQLStore is not read-only => false.
 void read(IDevTree tree, Map optionsMap, boolean readOnly, boolean createNew)
          Get all tables from the database described by the Properties entry in the optionsMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_accessor

private Accessor _accessor

log

private static Logger log
Logging .

Constructor Detail

AidaSQLStore

public AidaSQLStore()
Method Detail

isReadOnly

public boolean isReadOnly()
SQLStore is not read-only => false.

Specified by:
isReadOnly in interface IStore
Returns:
false.

read

public void read(IDevTree tree,
                 Map optionsMap,
                 boolean readOnly,
                 boolean createNew)
          throws IOException
Get all tables from the database described by the Properties entry in the optionsMap. It expects that all tables represent NTuples. If optionsMap contains hep.aida.ref.sq.table, only that table is requested.

Specified by:
read in interface IStore
Parameters:
tree - The Tree to read.
optionsMap - The map of options to be used.
readOnly - If the Tree should be opened in read-only mode.
createNew - If the Tree should be created.
Throws:
IOException - if the Tree can't be read.

commit

public void commit(IDevTree tree,
                   Map optionsMap)
            throws IOException
Commit all tables of the Tree.

Specified by:
commit in interface IStore
Parameters:
tree - The Tree to be commited into.
optionsMap - The map of options to be used.
Throws:
IOException - if the Tree can't be commited.

close

public void close()
           throws IOException
Disconnect from DB (if not running as JAS3 plugin).

Specified by:
close in interface IStore
Throws:
IOException

accessor

private Accessor accessor(Map optionsMap)
                   throws SQLTupleException
Get Accessor:
  1. If there is one already associated one, use it.
  2. If there isn't already associated one, ask Accessor Factory for it. Accessor Fatory will try to reuse Accessor corresponding to requested options Map if it exists. Otherwise, it will creae a new one.

Parameters:
optionsMap - The map of options to be used.
Returns:
The correspondng Accessor.
Throws:
SQLTupleException - if Accessor can't be created.

Written by: J.Hrivnac

Documentation built November 9 2010 on Linux by hrivnac