SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
Did you try using list.updateUI() method?
For the ENTER action you can use the KeyListener.
Today I have not one, but two questions.
Dave Tolls wrote:Can you show us the code that executes the entered queries?
Because whatever code it is it seems to be thinking that has a ResultSet expected, which isn't the case iwth a DELETE operation.
All things are lawful, but not all things are profitable.
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
Prasad Saya wrote:ResultSet rs = stmt.executeQuery(sql);
As Dave Tolls mentioned delete doesn't return a result set. You should use executeUpdate instead.
From Java API: executeUpdate executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.
Dave Tolls wrote:Try getMessage.
I think that should hold just the "Incorrect syntax near the keyword 'FROM'" part.
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
Prasad Saya wrote:What is he SQL script you are trying to run?
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
Dave Tolls wrote:Why is spliiting that text on GO incorrect?
That does seem to be the delimiter.
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
Dave Tolls wrote:I still think the requirements need to be defined.
Because if this is supposed to take in any old stuff from the user then there's likely to be more work involved.
Are they expecting to run actual SELECT queries for example?
As for the exception, the stack trace will tell you exactly where it occurred, from which you should be able to determine what is null.
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |