0

我有一个 PreparedStatement 和 CallableStatement:

String sql = "INSERT INTO parcels (cadastr,the_geom,status_id) VALUES(?,PolygonFromText(?, 4326),?)";
PreparedStatement stmt = ce.prepareStatement(sql);
stmt.setString(1, ts.getPackage().getSpecifyParcels().getExistParcel()
        .get(0).getCadastralNumber());
stmt.setString(2, WKT);
// stmt.setString(3, deleted);
stmt.setInt(3, status_id);
stmt.execute();
stmt.close();

java.sql.CallableStatement proc1 = ce
        .prepareCall("{call insert_into_wgs()}");
proc1.execute();
proc1.close();

insert_into_wgs()是否可以在一条语句中执行此查询和功能?

4

1 回答 1

1

使用返回关键字!

INSERT INTO parcels (cadastr,the_geom,status_id) 
VALUES (?, PolygonFromText(?, 4326), ?)
RETURNING insert_into_wgs()
于 2012-12-20T06:23:48.537 回答