簡體   English   中英

在JDBC中的SQL查詢中獲取語法錯誤

[英]Getting Syntax error in SQL query in JDBC

我收到語法錯誤,但我大部分可以肯定我所做的一切正確。 你可以看看嗎?

String ORDER, DROP, CAR;

            String Statement = "INSERT INTO WORKORDER"
                    + "(ORDER, DROPOFFDATE, COMPLETIONDATE) VALUES "
                    + "( ?, ?, null);";

            //JOptionPane.showMessageDialog(frame, Statement, "Daisy Imports", 3);
            try {
                PreparedStatement PST = connection.prepareStatement(Statement);
                ORDER = JOptionPane.showInputDialog("Please assign a order number for this order");
                int ORDERi = Integer.parseInt(ORDER);
                DROP = JOptionPane.showInputDialog("Please Enter the date the car was dropped off (YYYY-MM-DD)");
                CAR = JOptionPane.showInputDialog("Enter the VIN for the car this work order is for");
                PST.setInt(1, ORDERi);
                PST.setString(2, DROP);
                PST.execute();

在准備好的語句末尾嘗試擺脫分號。

編輯:問題是“ ORDER”是保留字。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM