All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mengweijin.flyway.database.gbase8s.Gbase8sTable Maven / Gradle / Ivy

Go to download

Flyway、Liquibase 扩展支持达梦(DM)数据库、南大通用(GBase 8s)数据库。

There is a newer version: 2.0.2
Show newest version
package com.github.mengweijin.flyway.database.gbase8s;

import org.flywaydb.core.internal.database.base.Table;
import org.flywaydb.core.internal.jdbc.JdbcTemplate;

import java.sql.SQLException;

/**
 * Gbase8s-specific table.
 * @author mengweijin
 */
public class Gbase8sTable extends Table {
    /**
     * Creates a new Gbase8s table.
     *
     * @param jdbcTemplate The Jdbc Template for communicating with the DB.
     * @param database The database-specific support.
     * @param schema The schema this table lives in.
     * @param name The name of the table.
     */
    Gbase8sTable(JdbcTemplate jdbcTemplate, Gbase8sDatabase database, Gbase8sSchema schema, String name) {
        super(jdbcTemplate, database, schema, name);
    }

    @Override
    protected void doDrop() throws SQLException {
        jdbcTemplate.execute("DROP TABLE " + name);
    }

    @Override
    protected boolean doExists() throws SQLException {
        return exists(null, schema, name);
    }

    @Override
    protected void doLock() throws SQLException {
        jdbcTemplate.update("lock table " + this + " in exclusive mode");
    }

    @Override
    public String toString() {
        return name;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy