protected void innerCreateSchema(Connection c,
PreparedStatement stmt) throws SQLException {
if (createTables)
{
c = this.getConnection();
boolean createdMessageTable = false;
try
{
stmt = c.prepareStatement(CREATE_MESSAGE_TABLE);
stmt.executeUpdate();
createdMessageTable = true;
}
catch (SQLException e)
{
log.debug("Could not create table with SQL: " + CREATE_MESSAGE_TABLE, e);
}
finally
{
try
{
if (stmt != null)
stmt.close();
}
catch (Throwable ignored)
{
log.trace("Ignored: " + ignored);
}
stmt = null;
}
if (createdMessageTable)
{
try
{
stmt = c.prepareStatement(CREATE_IDX_MESSAGE_TXOP_TXID);
stmt.executeUpdate();
}
catch (SQLException e)
{
log.debug("Could not create index with SQL: " + CREATE_IDX_MESSAGE_TXOP_TXID, e);
}
finally
{
try
{
if (stmt != null)
stmt.close();
}
catch (Throwable ignored)
{
log.trace("Ignored: " + ignored);
}
stmt = null;
}
try
{
stmt = c.prepareStatement(CREATE_IDX_MESSAGE_DESTINATION);
stmt.executeUpdate();
}
catch (SQLException e)
{
log.debug("Could not create index with SQL: " + CREATE_IDX_MESSAGE_DESTINATION, e);
}
finally
{
try
{
if (stmt != null)
stmt.close();
}
catch (Throwable ignored)
{
log.trace("Ignored: " + ignored);
}
stmt = null;
}
try
{
stmt = c.prepareStatement(CREATE_IDX_MESSAGE_MESSAGEID_DESTINATION);
stmt.executeUpdate();
}
catch (SQLException e)
{
log.debug("Could not create index with SQL: " + CREATE_IDX_MESSAGE_MESSAGEID_DESTINATION, e);
}
finally
{
try
{
if (stmt != null)
stmt.close();
}
catch (Throwable ignored)
{
log.trace("Ignored: " + ignored);
}
stmt = null;
}
}
try
{
stmt = c.prepareStatement(CREATE_TX_TABLE);
stmt.executeUpdate();
}
catch (SQLException e)
{
log.debug("Could not create table with SQL: " + CREATE_TX_TABLE, e);
}
finally
{
try
{
if (stmt != null)
stmt.close();
}
catch (Throwable ignored)
{
log.trace("Ignored: " + ignored);
}
stmt = null;
}
}
}
|