Results 1 to 1 of 1
-
Inserting string with slash character into database
Since slash (\) is a escape character in Java and also in database, therefore inserting a string containing slash is tricky in Java. If you try the following, you will get an exception:
Try the following for successful insertion:Java Code:stmt.executeUpdate("INSERT INTO mytable VALUES('\\')");
Java Code:stmt.executeUpdate("INSERT INTO mytable VALUES('\\\\')");
Similar Threads
-
Specifying the character set while connecting to the database
By Java Tip in forum Java TipReplies: 0Last Post: 02-13-2008, 11:26 AM -
Inserting into a table (Example)
By Java Tip in forum Java TipReplies: 0Last Post: 02-06-2008, 09:25 AM -
Inserting file in to database
By Java Tip in forum Java TipReplies: 0Last Post: 01-07-2008, 08:39 AM -
Database Column vs String Concatenation
By varun_33 in forum JDBCReplies: 1Last Post: 12-11-2007, 04:14 PM -
reading text character by character
By bugger in forum New To JavaReplies: 2Last Post: 11-09-2007, 08:54 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks