permaculture playing cards*
The moose likes JDBC and the fly likes mysql help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "mysql help" Watch "mysql help" New topic
Author

mysql help

Jardel Tan
Greenhorn

Joined: Sep 11, 2001
Posts: 14
hi
i would like to know how to insert a statement like
"i'm " into mysql table
insert into table values ('I'm')
Yogen Vadnere
Ranch Hand

Joined: Sep 20, 2001
Posts: 58
Please try following....
insert into table values ('I''m')

Yogen Vadnere
kim jungil
Greenhorn

Joined: Sep 27, 2001
Posts: 27
Originally posted by Jardel Tan:
hi
i would like to know how to insert a statement like
"i'm " into mysql table
insert into table values ('I'm')

you can try like this 'I\'m'
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

A third way (and definitely my favourite) use PreparedStatements - this lets each database driver type take care of the specifics for escaping data.

Dave
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: mysql help