在Apache Derby数据库中插入时获取自动生成的id。

时间:2016-05-01 11:41:40

标签: sql derby

或者有没有办法在另一个表中自动生成外键,即规范化表?

    createConnection();
            stmt = conn.createStatement();
            stmt.execute("insert into PRODUCTS(PRODUCTNAME, PURCHASEPRICE, RETAILPRICE, QUANTITY) values ( '"+product.getProductName()+"',"+product.getPurchasePrice()+","+product.getRetailPrice()+","+product.getQuantity()+")");
            stmt.close();
            shutdown();

0 个答案:

没有答案