Hi all,

I want to insert the string 'c:\Repository\Pack\' into a mysql table
using java and I did it as follows:

sql = "INSERT INTO files (filepath) VALUES ('c:\Repository\Pack\' )";
insertStmt.execute(sql);

I got an error and I know I should add an extra '\' to escape each of
the '\' in the above sql statement.  But, the problem is MS SQL and
Oracle do not treat '\' as an escape character in sql statements, and I
want to keep my Java program as database-independent as possible. (and I
don't want the whole string 'c:\\Repository\\Pack\\' to be stored in the
database when I use MS SQL server or Oracle)

Any suggestion to my problem will be greatly appreciated.

Thanks,
Kathy

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to