public class ConnectionHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
COUNT_ORDERS |
static String |
DELETE_ALL_ORDERS |
static String |
DELETE_INVENTORY |
static String |
INSERT_INVENTORY |
static String |
INSERT_ORDER |
static String |
jndiName |
static String |
SELECT_INVENTORY |
static String |
UPDATE_INVENTORY |
Constructor and Description |
---|
ConnectionHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanupConnection(Connection conn,
ResultSet rs,
PreparedStatement statement)
closes connection to DB
|
static Connection |
getConnection(DataSource dataSource) |
static Connection |
getConnection(DataSource dataSource,
boolean autoCommit) |
public static final String jndiName
public static final String INSERT_INVENTORY
public static final String UPDATE_INVENTORY
public static final String SELECT_INVENTORY
public static final String DELETE_INVENTORY
public static final String DELETE_ALL_ORDERS
public static final String INSERT_ORDER
public static final String COUNT_ORDERS
public static Connection getConnection(DataSource dataSource) throws SQLException
SQLException
public static Connection getConnection(DataSource dataSource, boolean autoCommit) throws SQLException
SQLException
public static void cleanupConnection(Connection conn, ResultSet rs, PreparedStatement statement)
conn
- - connection object to closers
- - result set object to closestatement
- - statement object to close© Copyright IBM Corp. 2015
Licensed under the Apache License, Version 2.0