de.opitzconsulting.orcas.diff.DatabaseHandlerPostgres Maven / Gradle / Ivy
The newest version!
package de.opitzconsulting.orcas.diff;
import java.util.ArrayList;
import java.util.List;
import de.opitzconsulting.orcas.sql.CallableStatementProvider;
import de.opitzconsulting.orcas.sql.WrapperExecuteStatement;
import de.opitzconsulting.origOrcasDsl.CharType;
public class DatabaseHandlerPostgres extends DatabaseHandler {
@Override
public void createOrcasUpdatesTable(String pOrcasUpdatesTableName, CallableStatementProvider pOrcasCallableStatementProvider) {
String
lSql =
"create table "
+ pOrcasUpdatesTableName
+ " ( scup_id serial, scup_script_name varchar(4000) not null, scup_logname varchar(100) not null, scup_date date not null, scup_schema varchar(30) not null, primary key (scup_id))";
new WrapperExecuteStatement(lSql, pOrcasCallableStatementProvider).execute();
}
@Override
public void insertIntoOrcasUpdatesTable(
String pOrcasUpdatesTableName,
CallableStatementProvider pOrcasCallableStatementProvider,
String pFilePart,
String pLogname) {
String lSql = "" + //
" insert into " + pOrcasUpdatesTableName + "(" + //
" scup_script_name," + //
" scup_date," + //
" scup_schema," + //
" scup_logname" + //
" )" + //
" values (" + //
" ?," + //
" current_timestamp," + //
" user," + //
" ?" + //
" )" + //
"";
List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy