小编kat*_*aty的帖子

JAVA SQL命令未正确结束

我有这个代码:

buy.addActionListener(new ActionListener()
{
    @Override
    public void actionPerformed(ActionEvent actionEvent)
    {
        int r;
        r = table.getSelectedRow();
        String num = (String) table.getValueAt(r, 0);//numele jucariei
        //String cop = (String) table.getValueAt(r, 3);//nr de bucati

        try
        {
            pq = stmt.executeQuery("SELECT *" + "FROM buyid_view");
            xv = stmt.executeQuery("SELECT toyid, copies " + "FROM alldatas_view" + "WHERE toyname ='"+num+"'");
            int buyid = pq.getInt("buyid");
            int toyid = xv.getInt("toyid");
            int copies = xv.getInt("copies");
            copies = copies-1;
            CallableStatement cstmt = con.prepareCall("INSERT INTO buy (buyid, toyid)" + "VALUES (?,?)");
            cstmt.setInt("buyid", buyid); …
Run Code Online (Sandbox Code Playgroud)

java oracle

-4
推荐指数
1
解决办法
581
查看次数

标签 统计

java ×1

oracle ×1