Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

double quotes

Thread view: 
usman - 21 Aug 2006 16:04 GMT
I have a string like this  ( test " A " ) and want to insert into the
database as same ( test " A " )
M.J. Dance - 21 Aug 2006 16:10 GMT
> I have a string like this  ( test " A " ) and want to insert into the
> database as same ( test " A " )

And the problem is?
usman - 21 Aug 2006 16:20 GMT
once again I am explaing my question is

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

> > I have a string like this  ( test " A " ) and want to insert into the
> > database as same ( test " A " )
>
> And the problem is?
Oliver Wong - 21 Aug 2006 16:47 GMT
[post re-ordered]

>> > I have a string like this  ( test " A " ) and want to insert into the
>> > database as same ( test " A " )
[quoted text clipped - 5 lines]
> 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
usman - 21 Aug 2006 17:00 GMT
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

> [post re-ordered]
>
[quoted text clipped - 14 lines]
>
>     - Oliver
Oliver Wong - 21 Aug 2006 19:26 GMT
>I am using oracle as my database
>
[quoted text clipped - 7 lines]
> 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
Luke Webber - 22 Aug 2006 01:35 GMT
>> I am using oracle as my database
>>
[quoted text clipped - 9 lines]
>
>    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
Moiristo - 21 Aug 2006 16:48 GMT
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.