double quotes

U

usman

I have a string like this ( test " A " ) and want to insert into the
database as same ( test " A " )
 
U

usman

once again I am explaing my question is

I am send string test"A" to database,
but I am getting string test that all.
 
O

Oliver Wong

[post re-ordered]

usman said:
once again I am explaing my question is

I am send string test"A" to database,
but I am getting string test that all.

A question usually has a question mark ('?') at the end.

Your database... does it use SQL? If so, what's the SQL statement you're
using to perform the insert? If not, what kind of database are you using?

- Oliver
 
M

Moiristo

usman said:
once again I am explaing my question is

I am send string test"A" to database,
but I am getting string test that all.

Is this a java question? Usually, you need to escape quotes using a
backslash ( test\"A\" ), but it may be the case that you need to double
escape it.
 
U

usman

I am using oracle as my database

string which I am setting the database as follows

cstmt.setString(2,mcNumber);

mcNumber is a string variable and it is getting the string as test"A"
but the database is taking test as a complete not test"A"

my problem is that string before the double quote is getting inserted
and reamining is not getting inserted into the database

Oliver said:
[post re-ordered]

usman said:
once again I am explaing my question is

I am send string test"A" to database,
but I am getting string test that all.

A question usually has a question mark ('?') at the end.

Your database... does it use SQL? If so, what's the SQL statement you're
using to perform the insert? If not, what kind of database are you using?

- Oliver
 
O

Oliver Wong

usman said:
I am using oracle as my database

string which I am setting the database as follows

cstmt.setString(2,mcNumber);

mcNumber is a string variable and it is getting the string as test"A"
but the database is taking test as a complete not test"A"

my problem is that string before the double quote is getting inserted
and reamining is not getting inserted into the database

What's the class of cstmt?

- Oliver
 
L

Luke Webber

Oliver said:
What's the class of cstmt?

....and are you /certain/ your string is correct when you get to the
setString logic? Have you tried displaying the contents to be certain?

Luke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,264
Messages
2,571,065
Members
48,770
Latest member
ElysaD

Latest Threads

Top