jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes sql exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "sql exception " Watch "sql exception " New topic
Author

sql exception

Aarthi moorthy
Greenhorn

Joined: Feb 24, 2003
Posts: 7
hi all,
I am updating a table with a set of values.
My code is

st.executeUpdate("update bulletinboard set (userid='"+s1+"',dateofposting='"+s2+"',messagetitle='"+s3+"',message='"+s4+"', administratorid='"+s5+"',typeofmessage='"+s6+"',expirydate='"+s7+"') where messageid=2");
I get an error as

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'messageid='.
Plz give me ur solutions..
Thanks in advance.
regards,
Aarthi.
Kirtikumar Puthran
Ranch Hand

Joined: Mar 04, 2003
Posts: 37
Hi Aarthi,
Try this :
st.executeUpdate("update bulletinboard set (userid='"+s1+"',dateofposting='"+s2+"',messagetitle='"+s3+"',message='"+s4+"', administratorid='"+s5+"',typeofmessage='"+s6+"',expirydate='"+s7+"') where messageid='2'");
I have changed the where clause.
Hope this helps.
Rgds,
Kirtikumar Puthran


Regards,<br />Kirti
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sql exception