org.nuiton.wikitty.jdbc
Class WikittyJDBCUtil

java.lang.Object
  extended by org.nuiton.wikitty.jdbc.WikittyJDBCUtil

public class WikittyJDBCUtil
extends Object

Version:
$Revision: 805 $ Last update: $Date: 2011-04-13 18:59:23 +0200 (mer., 13 avril 2011) $ by : $Author: bpoussin $
Author:
morin

Field Summary
static String COL_BINARY_VALUE
          boolean value column in the wikitty_data table
static String COL_BOOLEAN_VALUE
          boolean value column in the wikitty_data table
static String COL_DATE_VALUE
          date value column in the wikitty_data table
static String COL_DELETION_DATE
          deletion date column in wikitty_admin table
static String COL_EXTENSION
          extension list column in the wikitty_admin table
static String COL_FIELDNAME
          field name column in the data tables
static String COL_FIELDTYPE
          field type column in the extension_data table
static String COL_ID
          id column in all the tables
static String COL_NAME
          name column in the extension_admin table
static String COL_NUMBER_VALUE
          number value column in the wikitty_data table
static String COL_REQUIRES
          requires column in the extension_admin table
static String COL_TAGVALUES
          tagvalues column in the extension_admin table
static String COL_TEXT_VALUE
          text value column in the wikitty_data table
static String COL_VERSION
          version column in the admin tables
static String QUERY_CLEAR_EXTENSION
          clear extension query property name
static String QUERY_CLEAR_WIKITTY
          clear wikitty query property name
static String QUERY_COUNT_ACTIVE_WIKITTY
          count number of active (not deleted wikitties)
static String QUERY_COUNT_DELETED_WIKITTY
          count number of deleted
static String QUERY_CREATION_EXTENSION_ADMIN
           
static String QUERY_CREATION_EXTENSION_ADMIN_TEST
          extension_admin table creation query property name
static String QUERY_CREATION_EXTENSION_DATA
           
static String QUERY_CREATION_EXTENSION_DATA_TEST
          extension_data table creation query property name
static String QUERY_CREATION_WIKITTY_ADMIN
           
static String QUERY_CREATION_WIKITTY_ADMIN_TEST
          wikitty_admin table creation query property name
static String QUERY_CREATION_WIKITTY_DATA
          wikitty_data table creation query property name
static String QUERY_CREATION_WIKITTY_DATA_ALTER_BINARY
          wikitty_data column binary creation with alter query property name
static String QUERY_CREATION_WIKITTY_DATA_TEST
          wikitty_data table test exists query property name
static String QUERY_CREATION_WIKITTY_DATA_TEST_BINARY
          wikitty_data column binary test exits query property name
static String QUERY_DELETE_EXTENSION_ADMIN
           
static String QUERY_DELETE_EXTENSION_DATA
           
static String QUERY_DELETE_WIKITTY_ADMIN
          deletion in the admin table query property name
static String QUERY_DELETE_WIKITTY_DATA
          deletion in the data table query property name
static String QUERY_INSERT_EXTENSION_ADMIN
          insertion in the admin table query property name
static String QUERY_INSERT_EXTENSION_DATA
          insertion in the data table query property name
static String QUERY_INSERT_WIKITTY_ADMIN
          insertion in the admin table query property name
static String QUERY_INSERT_WIKITTY_DATA
          insertion in the data table query property name
static String QUERY_SELECT
          basic selection without where clause query property name
static String QUERY_SELECT_EXTENSION_ADMIN
          clear extension query property name
static String QUERY_SELECT_NOTDELETED
          basic selection without where clause query property name
static String QUERY_SELECT_TWO_WHERE
          basic selection with where clause query property name
static String QUERY_SELECT_WHERE
          basic selection with where clause query property name
static String QUERY_SELECT_WHERE_NOTDELETED
          not deleted data selection with where clause query property name
static String QUERY_UPDATE_WIKITTY_ADMIN
          update in the admin table query property name
protected static String TABLE_EXTENSION_ADMIN
          admin table name
protected static String TABLE_EXTENSION_DATA
          data table name
protected static String TABLE_WIKITTY_ADMIN
          admin table name
protected static String TABLE_WIKITTY_DATA
          data table name
 
Constructor Summary
WikittyJDBCUtil()
           
 
Method Summary
static void closeQuietly(Connection connection)
          Closes a connection.
static void commitJDBCConnection(Connection connection)
          Closes a connection (i.e. transaction) and commit data.
static void doQuery(Connection connection, String query, Object... args)
          Execute query.
static Connection getConnection(org.nuiton.util.ApplicationConfig conf)
          Get a new connection instance (i.e. it opens a new transaction) plug on JTA.
static Connection getJDBCConnection(org.nuiton.util.ApplicationConfig config)
          Get a new connection instance (i.e. it opens a new transaction).
static Properties loadQuery(org.nuiton.util.ApplicationConfig config)
          Loads the properties from configuration file, one or more properties can be load default load wikitty-jdbc-config.properties file.
static void rollbackJDBCConnection(Connection connection)
          Closes a connection (i.e. transaction) and rollback data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COL_EXTENSION

public static final String COL_EXTENSION
extension list column in the wikitty_admin table

See Also:
Constant Field Values

COL_VERSION

public static final String COL_VERSION
version column in the admin tables

See Also:
Constant Field Values

COL_ID

public static final String COL_ID
id column in all the tables

See Also:
Constant Field Values

COL_NAME

public static final String COL_NAME
name column in the extension_admin table

See Also:
Constant Field Values

COL_REQUIRES

public static final String COL_REQUIRES
requires column in the extension_admin table

See Also:
Constant Field Values

COL_TAGVALUES

public static final String COL_TAGVALUES
tagvalues column in the extension_admin table

See Also:
Constant Field Values

COL_FIELDNAME

public static final String COL_FIELDNAME
field name column in the data tables

See Also:
Constant Field Values

COL_FIELDTYPE

public static final String COL_FIELDTYPE
field type column in the extension_data table

See Also:
Constant Field Values

COL_BINARY_VALUE

public static final String COL_BINARY_VALUE
boolean value column in the wikitty_data table

See Also:
Constant Field Values

COL_BOOLEAN_VALUE

public static final String COL_BOOLEAN_VALUE
boolean value column in the wikitty_data table

See Also:
Constant Field Values

COL_NUMBER_VALUE

public static final String COL_NUMBER_VALUE
number value column in the wikitty_data table

See Also:
Constant Field Values

COL_TEXT_VALUE

public static final String COL_TEXT_VALUE
text value column in the wikitty_data table

See Also:
Constant Field Values

COL_DATE_VALUE

public static final String COL_DATE_VALUE
date value column in the wikitty_data table

See Also:
Constant Field Values

COL_DELETION_DATE

public static final String COL_DELETION_DATE
deletion date column in wikitty_admin table

See Also:
Constant Field Values

QUERY_SELECT

public static final String QUERY_SELECT
basic selection without where clause query property name

See Also:
Constant Field Values

QUERY_SELECT_NOTDELETED

public static final String QUERY_SELECT_NOTDELETED
basic selection without where clause query property name

See Also:
Constant Field Values

QUERY_COUNT_ACTIVE_WIKITTY

public static final String QUERY_COUNT_ACTIVE_WIKITTY
count number of active (not deleted wikitties)

See Also:
Constant Field Values

QUERY_COUNT_DELETED_WIKITTY

public static final String QUERY_COUNT_DELETED_WIKITTY
count number of deleted

See Also:
Constant Field Values

QUERY_SELECT_WHERE

public static final String QUERY_SELECT_WHERE
basic selection with where clause query property name

See Also:
Constant Field Values

QUERY_SELECT_TWO_WHERE

public static final String QUERY_SELECT_TWO_WHERE
basic selection with where clause query property name

See Also:
Constant Field Values

QUERY_SELECT_WHERE_NOTDELETED

public static final String QUERY_SELECT_WHERE_NOTDELETED
not deleted data selection with where clause query property name

See Also:
Constant Field Values

QUERY_CREATION_WIKITTY_ADMIN_TEST

public static final String QUERY_CREATION_WIKITTY_ADMIN_TEST
wikitty_admin table creation query property name

See Also:
Constant Field Values

QUERY_CREATION_WIKITTY_ADMIN

public static final String QUERY_CREATION_WIKITTY_ADMIN
See Also:
Constant Field Values

QUERY_CREATION_WIKITTY_DATA_TEST_BINARY

public static final String QUERY_CREATION_WIKITTY_DATA_TEST_BINARY
wikitty_data column binary test exits query property name

See Also:
Constant Field Values

QUERY_CREATION_WIKITTY_DATA_ALTER_BINARY

public static final String QUERY_CREATION_WIKITTY_DATA_ALTER_BINARY
wikitty_data column binary creation with alter query property name

See Also:
Constant Field Values

QUERY_CREATION_WIKITTY_DATA_TEST

public static final String QUERY_CREATION_WIKITTY_DATA_TEST
wikitty_data table test exists query property name

See Also:
Constant Field Values

QUERY_CREATION_WIKITTY_DATA

public static final String QUERY_CREATION_WIKITTY_DATA
wikitty_data table creation query property name

See Also:
Constant Field Values

QUERY_INSERT_WIKITTY_ADMIN

public static final String QUERY_INSERT_WIKITTY_ADMIN
insertion in the admin table query property name

See Also:
Constant Field Values

QUERY_UPDATE_WIKITTY_ADMIN

public static final String QUERY_UPDATE_WIKITTY_ADMIN
update in the admin table query property name

See Also:
Constant Field Values

QUERY_INSERT_WIKITTY_DATA

public static final String QUERY_INSERT_WIKITTY_DATA
insertion in the data table query property name

See Also:
Constant Field Values

QUERY_DELETE_WIKITTY_ADMIN

public static final String QUERY_DELETE_WIKITTY_ADMIN
deletion in the admin table query property name

See Also:
Constant Field Values

QUERY_DELETE_WIKITTY_DATA

public static final String QUERY_DELETE_WIKITTY_DATA
deletion in the data table query property name

See Also:
Constant Field Values

QUERY_CLEAR_EXTENSION

public static final String QUERY_CLEAR_EXTENSION
clear extension query property name

See Also:
Constant Field Values

QUERY_CLEAR_WIKITTY

public static final String QUERY_CLEAR_WIKITTY
clear wikitty query property name

See Also:
Constant Field Values

QUERY_SELECT_EXTENSION_ADMIN

public static final String QUERY_SELECT_EXTENSION_ADMIN
clear extension query property name

See Also:
Constant Field Values

QUERY_DELETE_EXTENSION_ADMIN

public static final String QUERY_DELETE_EXTENSION_ADMIN
See Also:
Constant Field Values

QUERY_DELETE_EXTENSION_DATA

public static final String QUERY_DELETE_EXTENSION_DATA
See Also:
Constant Field Values

QUERY_CREATION_EXTENSION_ADMIN_TEST

public static final String QUERY_CREATION_EXTENSION_ADMIN_TEST
extension_admin table creation query property name

See Also:
Constant Field Values

QUERY_CREATION_EXTENSION_ADMIN

public static final String QUERY_CREATION_EXTENSION_ADMIN
See Also:
Constant Field Values

QUERY_CREATION_EXTENSION_DATA_TEST

public static final String QUERY_CREATION_EXTENSION_DATA_TEST
extension_data table creation query property name

See Also:
Constant Field Values

QUERY_CREATION_EXTENSION_DATA

public static final String QUERY_CREATION_EXTENSION_DATA
See Also:
Constant Field Values

QUERY_INSERT_EXTENSION_ADMIN

public static final String QUERY_INSERT_EXTENSION_ADMIN
insertion in the admin table query property name

See Also:
Constant Field Values

QUERY_INSERT_EXTENSION_DATA

public static final String QUERY_INSERT_EXTENSION_DATA
insertion in the data table query property name

See Also:
Constant Field Values

TABLE_WIKITTY_ADMIN

protected static String TABLE_WIKITTY_ADMIN
admin table name


TABLE_WIKITTY_DATA

protected static String TABLE_WIKITTY_DATA
data table name


TABLE_EXTENSION_ADMIN

protected static String TABLE_EXTENSION_ADMIN
admin table name


TABLE_EXTENSION_DATA

protected static String TABLE_EXTENSION_DATA
data table name

Constructor Detail

WikittyJDBCUtil

public WikittyJDBCUtil()
Method Detail

loadQuery

public static Properties loadQuery(org.nuiton.util.ApplicationConfig config)
Loads the properties from configuration file, one or more properties can be load default load wikitty-jdbc-config.properties file.

Parameters:
properties - custom properties to override default configuration
Returns:
the properties for the queries

getConnection

public static Connection getConnection(org.nuiton.util.ApplicationConfig conf)
Get a new connection instance (i.e. it opens a new transaction) plug on JTA.

Parameters:
conf - configuration
Returns:
a new Connection (db transaction)

closeQuietly

public static void closeQuietly(Connection connection)
Closes a connection.

Parameters:
connection - the connection to close

getJDBCConnection

public static Connection getJDBCConnection(org.nuiton.util.ApplicationConfig config)
Get a new connection instance (i.e. it opens a new transaction).

Returns:
a new Connection (db transaction)
Throws:
SQLException - if the connection fails

commitJDBCConnection

public static void commitJDBCConnection(Connection connection)
Closes a connection (i.e. transaction) and commit data.

Parameters:
connection - the connection to close and commit

rollbackJDBCConnection

public static void rollbackJDBCConnection(Connection connection)
Closes a connection (i.e. transaction) and rollback data.

Parameters:
connection - the connection to close and rollback

doQuery

public static void doQuery(Connection connection,
                           String query,
                           Object... args)
                    throws SQLException
Execute query.

Parameters:
connection - connection to use
query - sql query to do
args - arguments for the query
Throws:
SQLException


Copyright © 2009-2011 CodeLutin. All Rights Reserved.