66import com .datastax .driver .core .schemabuilder .SchemaBuilder ;
77import com .scalar .db .config .DatabaseConfig ;
88import com .scalar .db .storage .cassandra .ClusterManager ;
9- import com .scalar .db .storage .jdbc .JdbcAdmin ;
109import com .scalar .db .storage .jdbc .JdbcConfig ;
1110import com .scalar .db .storage .jdbc .JdbcTestUtils ;
1211import com .scalar .db .storage .jdbc .JdbcUtils ;
1312import com .scalar .db .storage .jdbc .RdbEngineFactory ;
14- import com .scalar .db .storage .jdbc .RdbEngineOracle ;
1513import com .scalar .db .storage .jdbc .RdbEngineStrategy ;
14+ import com .scalar .db .storage .jdbc .TableMetadataService ;
1615import com .scalar .db .util .AdminTestUtils ;
1716import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
1817import java .sql .Connection ;
@@ -52,14 +51,9 @@ public void dropMetadataTable() throws SQLException {
5251 // for JDBC
5352 execute (
5453 "DROP TABLE "
55- + rdbEngine .encloseFullTableName (jdbcMetadataSchema , JdbcAdmin . METADATA_TABLE ));
54+ + rdbEngine .encloseFullTableName (jdbcMetadataSchema , TableMetadataService . TABLE_NAME ));
5655
57- String dropNamespaceStatement ;
58- if (rdbEngine instanceof RdbEngineOracle ) {
59- dropNamespaceStatement = "DROP USER " + rdbEngine .enclose (jdbcMetadataSchema );
60- } else {
61- dropNamespaceStatement = "DROP SCHEMA " + rdbEngine .enclose (jdbcMetadataSchema );
62- }
56+ String dropNamespaceStatement = rdbEngine .dropNamespaceSql (jdbcMetadataSchema );
6357 execute (dropNamespaceStatement );
6458 }
6559
@@ -70,7 +64,7 @@ public void truncateMetadataTable() throws Exception {
7064 // for JDBC
7165 String truncateTableStatement =
7266 "TRUNCATE TABLE "
73- + rdbEngine .encloseFullTableName (jdbcMetadataSchema , JdbcAdmin . METADATA_TABLE );
67+ + rdbEngine .encloseFullTableName (jdbcMetadataSchema , TableMetadataService . TABLE_NAME );
7468 execute (truncateTableStatement );
7569 }
7670
@@ -82,7 +76,7 @@ public void corruptMetadata(String namespace, String table) throws Exception {
8276 // for JDBC
8377 String insertCorruptedMetadataStatement =
8478 "INSERT INTO "
85- + rdbEngine .encloseFullTableName (jdbcMetadataSchema , JdbcAdmin . METADATA_TABLE )
79+ + rdbEngine .encloseFullTableName (jdbcMetadataSchema , TableMetadataService . TABLE_NAME )
8680 + " VALUES ('"
8781 + getFullTableName (namespace , table )
8882 + "','corrupted','corrupted','corrupted','corrupted','0','0')" ;
@@ -96,9 +90,9 @@ public void deleteMetadata(String namespace, String table) throws Exception {
9690 // for JDBC
9791 String deleteMetadataStatement =
9892 "DELETE FROM "
99- + rdbEngine .encloseFullTableName (jdbcMetadataSchema , JdbcAdmin . METADATA_TABLE )
93+ + rdbEngine .encloseFullTableName (jdbcMetadataSchema , TableMetadataService . TABLE_NAME )
10094 + " WHERE "
101- + rdbEngine .enclose (JdbcAdmin . METADATA_COL_FULL_TABLE_NAME )
95+ + rdbEngine .enclose (TableMetadataService . COL_FULL_TABLE_NAME )
10296 + " = ?" ;
10397 try (Connection connection = dataSource .getConnection ();
10498 PreparedStatement preparedStatement =
0 commit comments