本文整理汇总了Java中org.hsqldb.Table.MEMORY_TABLE属性的典型用法代码示例。如果您正苦于以下问题:Java Table.MEMORY_TABLE属性的具体用法?Java Table.MEMORY_TABLE怎么用?Java Table.MEMORY_TABLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.hsqldb.Table
的用法示例。
在下文中一共展示了Table.MEMORY_TABLE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeExistingData
protected void writeExistingData() throws HsqlException, IOException {
boolean wroteTable = false;
HsqlArrayList tables = db.getTables();
for (int i = 0, size = tables.size(); i < size; i++) {
Table t = (Table) tables.get(i);
// write all memory table data
// write cached table data unless index roots have been written
// write all text table data apart from readonly text tables
// unless index roots have been written
boolean script = false;
switch (t.getTableType()) {
case Table.MEMORY_TABLE :
script = true;
break;
case Table.CACHED_TABLE :
script = includeCachedData;
break;
case Table.TEXT_TABLE :
script = includeCachedData &&!t.isReadOnly();
break;
}
try {
if (script) {
writeTableInit(t);
RowIterator it = t.rowIterator();
while (it.hasNext()) {
writeRow(0, t, it.next().getData());
}
writeTableTerm(t);
}
} catch (Exception e) {
throw Trace.error(Trace.ASSERT_FAILED, e.getMessage());
}
}
writeDataTerm();
}
示例2: writeExistingData
protected void writeExistingData() throws HsqlException, IOException {
// start with blank schema - SET SCHEMA to log
currentSession.loggedSchema = null;
Iterator schemas = database.schemaManager.userSchemaNameIterator();
while (schemas.hasNext()) {
String schema = (String) schemas.next();
Iterator tables = database.schemaManager.tablesIterator(schema);
while (tables.hasNext()) {
Table t = (Table) tables.next();
// write all memory table data
// write cached table data unless index roots have been written
// write all text table data apart from readonly text tables
// unless index roots have been written
boolean script = false;
switch (t.getTableType()) {
case Table.MEMORY_TABLE :
script = true;
break;
case Table.CACHED_TABLE :
script = includeCachedData;
break;
case Table.TEXT_TABLE :
script = includeCachedData &&!t.isReadOnly();
break;
}
int rowCount = 0;
try {
if (script) {
schemaToLog = t.getName().schema;
writeTableInit(t);
RowIterator it = t.rowIterator(currentSession);
rowCount = 0;
while (it.hasNext()) {
writeRow(currentSession, t, it.next().getData());
rowCount++;
}
writeTableTerm(t);
}
} catch (Throwable e) {
this.database.logger.appLog.logContext(
SimpleLog.LOG_ERROR,
t.getName().name + " problem after row " + rowCount);
System.gc();
throw Trace.error(Trace.ASSERT_FAILED, e.toString());
}
}
}
writeDataTerm();
}
示例3: writeExistingData
protected void writeExistingData() throws HsqlException, IOException {
// start with blank schema - SET SCHEMA to log
currentSession.loggedSchema = null;
Iterator schemas = database.schemaManager.userSchemaNameIterator();
while (schemas.hasNext()) {
String schema = (String) schemas.next();
Iterator tables = database.schemaManager.tablesIterator(schema);
while (tables.hasNext()) {
Table t = (Table) tables.next();
// write all memory table data
// write cached table data unless index roots have been written
// write all text table data apart from readonly text tables
// unless index roots have been written
boolean script = false;
switch (t.getTableType()) {
case Table.MEMORY_TABLE :
script = true;
break;
case Table.CACHED_TABLE :
script = includeCachedData;
break;
case Table.TEXT_TABLE :
script = includeCachedData && !t.isReadOnly();
break;
}
int rowCount = 0;
try {
if (script) {
schemaToLog = t.getName().schema;
writeTableInit(t);
RowIterator it = t.rowIterator(currentSession);
rowCount = 0;
while (it.hasNext()) {
writeRow(currentSession, t, it.next().getData());
rowCount++;
}
writeTableTerm(t);
}
} catch (Throwable e) {
this.database.logger.appLog.logContext(
SimpleLog.LOG_ERROR,
t.getName().name + " problem after row " + rowCount);
System.gc();
throw Trace.error(Trace.ASSERT_FAILED, e.toString());
}
}
}
writeDataTerm();
}