Rename SQL table.
This commit is contained in:
parent
0ed02e7d99
commit
dd838b4104
4 changed files with 52 additions and 52 deletions
|
@ -108,7 +108,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
//
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("UPDATE elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY IS NULL");
|
||||
statement = connection.prepareStatement("UPDATE sikevadb_elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY IS NULL");
|
||||
|
||||
statement.setTimestamp(1, toTimestamp(element.getArchiveDate()));
|
||||
statement.setString(2, element.getKey());
|
||||
|
@ -147,7 +147,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
//
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("UPDATE elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY=?");
|
||||
statement = connection.prepareStatement("UPDATE sikevadb_elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY=?");
|
||||
|
||||
statement.setTimestamp(1, toTimestamp(element.getArchiveDate()));
|
||||
statement.setString(2, element.getKey());
|
||||
|
@ -175,7 +175,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
//
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("DELETE FROM elements WHERE ARCHIVE_DATE IS NOT NULL");
|
||||
statement = connection.prepareStatement("DELETE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NOT NULL");
|
||||
|
||||
statement.executeUpdate();
|
||||
|
||||
|
@ -201,7 +201,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
//
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("DELETE FROM elements WHERE ARCHIVE_DATE IS NOT NULL AND UNIX_TIMESTAMP(ARCHIVE_DATE)<?");
|
||||
statement = connection.prepareStatement("DELETE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NOT NULL AND UNIX_TIMESTAMP(ARCHIVE_DATE)<?");
|
||||
|
||||
statement.setLong(1, beforeDate.getMillis() / 1000);
|
||||
|
||||
|
@ -243,7 +243,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
//
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("DELETE FROM elements");
|
||||
statement = connection.prepareStatement("DELETE FROM sikevadb_elements");
|
||||
|
||||
statement.executeUpdate();
|
||||
|
||||
|
@ -319,7 +319,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
statement = connection.createStatement();
|
||||
resultSet = statement.executeQuery("SELECT count(*) FROM elements");
|
||||
resultSet = statement.executeQuery("SELECT count(*) FROM sikevadb_elements");
|
||||
|
||||
resultSet.next();
|
||||
result = resultSet.getLong(1);
|
||||
|
@ -345,7 +345,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT count(*) FROM elements WHERE TOPKEY=?");
|
||||
statement = connection.prepareStatement("SELECT count(*) FROM sikevadb_elements WHERE TOPKEY=?");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -377,7 +377,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT count(*) FROM elements WHERE TOPKEY=? AND SUBKEY=?");
|
||||
statement = connection.prepareStatement("SELECT count(*) FROM sikevadb_elements WHERE TOPKEY=? AND SUBKEY=?");
|
||||
statement.setString(1, key);
|
||||
statement.setString(2, subkey);
|
||||
resultSet = statement.executeQuery();
|
||||
|
@ -408,7 +408,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.createStatement();
|
||||
resultSet = statement.executeQuery("SELECT count(*) FROM elements WHERE ARCHIVE_DATE IS NOT NULL");
|
||||
resultSet = statement.executeQuery("SELECT count(*) FROM sikevadb_elements WHERE ARCHIVE_DATE IS NOT NULL");
|
||||
|
||||
resultSet.next();
|
||||
result = resultSet.getLong(1);
|
||||
|
@ -434,7 +434,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT count(*) FROM elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=?");
|
||||
statement = connection.prepareStatement("SELECT count(*) FROM sikevadb_elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=?");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -466,7 +466,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT count(*) FROM elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=? AND SUBKEY=?");
|
||||
statement = connection.prepareStatement("SELECT count(*) FROM sikevadb_elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=? AND SUBKEY=?");
|
||||
statement.setString(1, key);
|
||||
statement.setString(2, subkey);
|
||||
resultSet = statement.executeQuery();
|
||||
|
@ -499,7 +499,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.createStatement();
|
||||
resultSet = statement.executeQuery("SELECT count(*) FROM elements WHERE ARCHIVE_DATE IS NULL");
|
||||
resultSet = statement.executeQuery("SELECT count(*) FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL");
|
||||
|
||||
resultSet.next();
|
||||
result = resultSet.getLong(1);
|
||||
|
@ -527,7 +527,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT count(*) FROM elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=?");
|
||||
statement = connection.prepareStatement("SELECT count(*) FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=?");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -559,7 +559,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT count(*) FROM elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY=?");
|
||||
statement = connection.prepareStatement("SELECT count(*) FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY=?");
|
||||
statement.setString(1, key);
|
||||
statement.setString(2, subkey);
|
||||
resultSet = statement.executeQuery();
|
||||
|
@ -616,7 +616,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
System.out.println("============================== APRÈS");
|
||||
|
||||
statement = connection.createStatement();
|
||||
statement.execute("delete from elements");
|
||||
statement.execute("delete from sikevadb_elements");
|
||||
|
||||
System.out.println("============================== APRÈS2");
|
||||
}
|
||||
|
@ -643,7 +643,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection
|
||||
.prepareStatement("SELECT TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE FROM elements WHERE TOPKEY=? ORDER BY ARCHIVE_DATE ASC");
|
||||
.prepareStatement("SELECT TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE FROM sikevadb_elements WHERE TOPKEY=? ORDER BY ARCHIVE_DATE ASC");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -693,7 +693,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection
|
||||
.prepareStatement("SELECT TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE FROM elements WHERE TOPKEY=? AND SUBKEY=? ORDER BY ARCHIVE_DATE ASC");
|
||||
.prepareStatement("SELECT TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE FROM sikevadb_elements WHERE TOPKEY=? AND SUBKEY=? ORDER BY ARCHIVE_DATE ASC");
|
||||
statement.setString(1, key);
|
||||
statement.setString(2, subkey);
|
||||
resultSet = statement.executeQuery();
|
||||
|
@ -740,7 +740,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT DISTINCT TOPKEY FROM elements ORDER BY CREATION_DATE ASC");
|
||||
statement = connection.prepareStatement("SELECT DISTINCT TOPKEY FROM sikevadb_elements ORDER BY CREATION_DATE ASC");
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
while (resultSet.next()) {
|
||||
|
@ -773,7 +773,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT DISTINCT SUBKEY FROM elements WHERE TOPKEY=? ORDER BY CREATION_DATE ASC");
|
||||
statement = connection.prepareStatement("SELECT DISTINCT SUBKEY FROM sikevadb_elements WHERE TOPKEY=? ORDER BY CREATION_DATE ASC");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -807,7 +807,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT VALUE FROM elements WHERE TOPKEY=? ORDER BY ARCHIVE_DATE ASC");
|
||||
statement = connection.prepareStatement("SELECT VALUE FROM sikevadb_elements WHERE TOPKEY=? ORDER BY ARCHIVE_DATE ASC");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -845,7 +845,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT VALUE FROM elements WHERE TOPKEY=? AND SUBKEY=? ORDER BY ARCHIVE_DATE ASC");
|
||||
statement = connection.prepareStatement("SELECT VALUE FROM sikevadb_elements WHERE TOPKEY=? AND SUBKEY=? ORDER BY ARCHIVE_DATE ASC");
|
||||
statement.setString(1, key);
|
||||
statement.setString(2, subkey);
|
||||
resultSet = statement.executeQuery();
|
||||
|
@ -881,7 +881,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT VALUE FROM elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=? ORDER BY CREATION_DATE");
|
||||
statement = connection.prepareStatement("SELECT VALUE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=? ORDER BY CREATION_DATE");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -920,7 +920,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection
|
||||
.prepareStatement("SELECT VALUE FROM elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=? AND SUBKEY=? ORDER BY ARCHIVE_DATE ASC");
|
||||
.prepareStatement("SELECT VALUE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=? AND SUBKEY=? ORDER BY ARCHIVE_DATE ASC");
|
||||
statement.setString(1, key);
|
||||
statement.setString(2, subkey);
|
||||
resultSet = statement.executeQuery();
|
||||
|
@ -987,7 +987,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection
|
||||
.prepareStatement("SELECT TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE FROM elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY IS NULL");
|
||||
.prepareStatement("SELECT TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY IS NULL");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -1041,7 +1041,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection
|
||||
.prepareStatement("SELECT TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE FROM elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY=?");
|
||||
.prepareStatement("SELECT TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY=?");
|
||||
statement.setString(1, key);
|
||||
statement.setString(2, subkey);
|
||||
resultSet = statement.executeQuery();
|
||||
|
@ -1094,7 +1094,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection
|
||||
.prepareStatement("SELECT TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE FROM elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=? ORDER BY CREATION_DATE ASC");
|
||||
.prepareStatement("SELECT TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=? ORDER BY CREATION_DATE ASC");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -1144,7 +1144,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection
|
||||
.prepareStatement("SELECT TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE FROM elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=? AND SUBKEY=? ORDER BY CREATION_DATE ASC");
|
||||
.prepareStatement("SELECT TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=? AND SUBKEY=? ORDER BY CREATION_DATE ASC");
|
||||
statement.setString(1, key);
|
||||
statement.setString(2, subkey);
|
||||
resultSet = statement.executeQuery();
|
||||
|
@ -1191,7 +1191,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT DISTINCT TOPKEY FROM elements WHERE ARCHIVE_DATE IS NULL");
|
||||
statement = connection.prepareStatement("SELECT DISTINCT TOPKEY FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL");
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
while (resultSet.next()) {
|
||||
|
@ -1233,7 +1233,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection
|
||||
.prepareStatement("SELECT DISTINCT SUBKEY,CREATION_DATE FROM elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY IS NOT NULL ORDER BY CREATION_DATE ASC");
|
||||
.prepareStatement("SELECT DISTINCT SUBKEY,CREATION_DATE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY IS NOT NULL ORDER BY CREATION_DATE ASC");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -1269,7 +1269,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
//
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT VALUE FROM elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=?");
|
||||
statement = connection.prepareStatement("SELECT VALUE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=?");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -1312,7 +1312,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
//
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT VALUE FROM elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY=?");
|
||||
statement = connection.prepareStatement("SELECT VALUE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY=?");
|
||||
statement.setString(1, key);
|
||||
statement.setString(2, subkey);
|
||||
resultSet = statement.executeQuery();
|
||||
|
@ -1357,7 +1357,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection
|
||||
.prepareStatement("SELECT VALUE,CREATION_DATE FROM elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? ORDER BY CREATION_DATE ASC");
|
||||
.prepareStatement("SELECT VALUE,CREATION_DATE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? ORDER BY CREATION_DATE ASC");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -1396,7 +1396,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection
|
||||
.prepareStatement("SELECT VALUE FROM elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY=? ORDER BY ARCHIVE_DATE ASC");
|
||||
.prepareStatement("SELECT VALUE FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY=? ORDER BY ARCHIVE_DATE ASC");
|
||||
statement.setString(1, key);
|
||||
statement.setString(2, subkey);
|
||||
resultSet = statement.executeQuery();
|
||||
|
@ -1429,7 +1429,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT SUM(SIZE) FROM elements");
|
||||
statement = connection.prepareStatement("SELECT SUM(SIZE) FROM sikevadb_elements");
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
resultSet.next();
|
||||
|
@ -1457,7 +1457,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT SUM(SIZE) FROM elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=?");
|
||||
statement = connection.prepareStatement("SELECT SUM(SIZE) FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=?");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -1490,7 +1490,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT SUM(SIZE) FROM elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY=?");
|
||||
statement = connection.prepareStatement("SELECT SUM(SIZE) FROM sikevadb_elements WHERE ARCHIVE_DATE IS NULL AND TOPKEY=? AND SUBKEY=?");
|
||||
statement.setString(1, key);
|
||||
statement.setString(2, subkey);
|
||||
resultSet = statement.executeQuery();
|
||||
|
@ -1547,7 +1547,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT SUM(SIZE) FROM elements WHERE ARCHIVE_DATE IS NOT NULL");
|
||||
statement = connection.prepareStatement("SELECT SUM(SIZE) FROM sikevadb_elements WHERE ARCHIVE_DATE IS NOT NULL");
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
resultSet.next();
|
||||
|
@ -1575,7 +1575,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT SUM(SIZE) FROM elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=?");
|
||||
statement = connection.prepareStatement("SELECT SUM(SIZE) FROM sikevadb_elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=?");
|
||||
statement.setString(1, key);
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
|
@ -1608,7 +1608,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("SELECT SUM(SIZE) FROM elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=? AND SUBKEY=?");
|
||||
statement = connection.prepareStatement("SELECT SUM(SIZE) FROM sikevadb_elements WHERE ARCHIVE_DATE IS NOT NULL AND TOPKEY=? AND SUBKEY=?");
|
||||
statement.setString(1, key);
|
||||
statement.setString(2, subkey);
|
||||
resultSet = statement.executeQuery();
|
||||
|
@ -1666,7 +1666,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection
|
||||
.prepareStatement("INSERT INTO elements (TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE) VALUES(?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
.prepareStatement("INSERT INTO sikevadb_elements (TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE) VALUES(?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
|
||||
statement.setString(1, element.getKey());
|
||||
statement.setString(2, element.getSubkey());
|
||||
|
@ -1715,7 +1715,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection.setAutoCommit(false);
|
||||
|
||||
// Archive existing element.
|
||||
statement = connection.prepareStatement("UPDATE elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY IS NULL");
|
||||
statement = connection.prepareStatement("UPDATE sikevadb_elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY IS NULL");
|
||||
|
||||
statement.setTimestamp(1, toTimestamp(element.getEditionDate()));
|
||||
statement.setString(2, element.getKey());
|
||||
|
@ -1726,7 +1726,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
// Insert new version of the element.
|
||||
statement.clearParameters();
|
||||
statement = connection
|
||||
.prepareStatement("INSERT INTO elements (TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE) VALUES(?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
.prepareStatement("INSERT INTO sikevadb_elements (TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE) VALUES(?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
|
||||
statement.setString(1, element.getKey());
|
||||
statement.setString(2, element.getSubkey());
|
||||
|
@ -1784,7 +1784,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
connection.setAutoCommit(false);
|
||||
|
||||
// Archive existing element.
|
||||
statement = connection.prepareStatement("UPDATE elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY=?");
|
||||
statement = connection.prepareStatement("UPDATE sikevadb_elements SET ARCHIVE_DATE=? WHERE TOPKEY=? AND SUBKEY=?");
|
||||
|
||||
statement.setTimestamp(1, toTimestamp(element.getEditionDate()));
|
||||
statement.setString(2, element.getKey());
|
||||
|
@ -1796,7 +1796,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
// Insert new version of the element.
|
||||
statement.clearParameters();
|
||||
statement = connection
|
||||
.prepareStatement("INSERT INTO elements (TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE) VALUES(?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
.prepareStatement("INSERT INTO sikevadb_elements (TOPKEY,SUBKEY,VALUE,SIZE,DIGEST,CREATION_DATE,EDITION_DATE,ARCHIVE_DATE) VALUES(?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
|
||||
statement.setString(1, element.getKey());
|
||||
statement.setString(2, element.getSubkey());
|
||||
|
@ -1841,7 +1841,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
//
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("DELETE FROM elements WHERE TOPKEY=? AND SUBKEY IS NULL");
|
||||
statement = connection.prepareStatement("DELETE FROM sikevadb_elements WHERE TOPKEY=? AND SUBKEY IS NULL");
|
||||
|
||||
statement.setString(1, element.getKey());
|
||||
|
||||
|
@ -1874,7 +1874,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
try {
|
||||
//
|
||||
connection = getConnection();
|
||||
statement = connection.prepareStatement("DELETE FROM elements WHERE TOPKEY=? AND SUBKEY=?");
|
||||
statement = connection.prepareStatement("DELETE FROM sikevadb_elements WHERE TOPKEY=? AND SUBKEY=?");
|
||||
|
||||
statement.setString(1, element.getKey());
|
||||
statement.setString(2, element.getSubkey());
|
||||
|
@ -1909,7 +1909,7 @@ public class SQLSikevaDB implements SikevaDB {
|
|||
//
|
||||
connection = getConnection();
|
||||
connection.setAutoCommit(true);
|
||||
statement = connection.prepareStatement("DELETE FROM elements WHERE TOPKEY=? AND SUBKEY IS NOT NULL");
|
||||
statement = connection.prepareStatement("DELETE FROM sikevadb_elements WHERE TOPKEY=? AND SUBKEY IS NOT NULL");
|
||||
|
||||
statement.setString(1, element.getKey());
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
-- Specific file for HSQLDB due difference between MySQL yntax and HSQLDB syntax.
|
||||
-- Warning: there is a convention about the file name.
|
||||
|
||||
DROP TABLE IF EXISTS elements;
|
||||
CREATE TABLE IF NOT EXISTS elements (
|
||||
DROP TABLE IF EXISTS sikevadb_elements;
|
||||
CREATE TABLE IF NOT EXISTS sikevadb_elements (
|
||||
`ID` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`TOPKEY` varchar(255) NOT NULL,
|
||||
`SUBKEY` varchar(255) DEFAULT NULL,
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
-- Structure de la table `elements`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `elements`;
|
||||
CREATE TABLE IF NOT EXISTS `elements` (
|
||||
DROP TABLE IF EXISTS `sikevadb_elements`;
|
||||
CREATE TABLE IF NOT EXISTS `sikevadb_elements` (
|
||||
`ID` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`TOPKEY` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`SUBKEY` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<dataset>
|
||||
<ELEMENTS
|
||||
<SIKEVADB_ELEMENTS
|
||||
TOPKEY="alpha"
|
||||
SUBKEY="NULL"
|
||||
SIZE="10"
|
||||
|
|
Loading…
Reference in a new issue