Oracle invalid identifier doesnt understand string

后端 未结 1 1059
失恋的感觉
失恋的感觉 2021-01-25 17:29

I\'m having an issue with my query not working. This is the command variable.

When it executes it should be retrieving the tuples that have BSc as their deg

相关标签:
1条回答
  • 2021-01-25 18:12

    In JDBC your SQL statement should not be terminated by semicolon.

    Change

    String command = "SELECT distinct fname, lname, student_id FROM student"+
           " where degree='"+ degree + "';";
    

    to

    String command = "SELECT distinct fname, lname, student_id FROM student"+
           " where degree='"+ degree + "'";
    
    0 讨论(0)
提交回复
热议问题