DDL
命令如下:我们可以在预备语句(PostgreSQL)中使用DDL命令吗?
CREATE TABLE
- 使用用户提供的列名创建表。
DROP TABLE
- 删除所有行并从数据库中删除表定义。
ALTER TABLE
- 添加或删除表中的列。
如果在PostgreSQL和Java中有可能使用这些命令,我需要几个例子吗?
public boolean create(Employee employee) {
try {
callableStatement = openConnection().prepareCall("{call insert_employee(?,?,?)}");
callableStatement.setInt(1, employee.getEid());
callableStatement.setString(2, employee.getEname());
callableStatement.setInt(3, employee.getSid());
i = callableStatement.execute();
callableStatement.close();
closeConnection();
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return i;
}
有没有在这种类型中使用DDL CREATE命令的机会?使用预准备报表?
@CraigRinger我删除了那个链接,那是为了纠正我 – Microtechie