aspose file tools*
The moose likes Struts and the fly likes regarding Update syntax of query 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 » Frameworks » Struts
Bookmark "regarding Update syntax of query" Watch "regarding Update syntax of query" New topic
Author

regarding Update syntax of query

smitaj joshi
Greenhorn

Joined: Dec 24, 2008
Posts: 3
String sql="update registration set phoneno=" + phone1 + ","+ "emailid=" + emailid1 + " where name="+name1;
System.out.println(sql);
stmt=con.prepareStatement(sql);
stmt.executeUpdate()
stmt.close();
con.close();
ouput of sql-> update registration set phoneno=9860878112,emailid=smita.joshi@gmail.com where name=smita


[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'smita.joshi@gmail.com'.
Dany Mendez
Greenhorn

Joined: Nov 04, 2008
Posts: 14
Hello smitaj joshi,

I dont't work with that DBMS, I use oracle, so this is a suggestion.

I can see that you do not limit the strings, could that be the problem?
Like so,
update registration set phoneno=9860878112,emailid='smita.joshi@gmail.com' where name='smita'

Regards
 
Don't get me started about those stupid light bulbs.
 
subject: regarding Update syntax of query