• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 855
  • Last Modified:

Java insert into Oracle an string which have comma and crlf

Hello!

I'm coding a Java/JSP page.
I have a string like this:

A
BC, DE
FFF,GGG


I mean it have enter charachter and also comma.

How can I put it in my column which is varchar2(4000) ?

I cannot do that like this: Insert into table (column1, column2) (mystringwhichhaveenter, mystringwhichhavecomma)

So how can I do that?

Thanks from now!
0
CSecurity
Asked:
CSecurity
  • 3
1 Solution
 
Ajay-SinghCommented:
Use PreparedStatement
0
 
Ajay-SinghCommented:
0
 
CSecurityAuthor Commented:
I'm getting this error:

can bind a LONG value only for insert into a LONG column

I haven't LONG data type in entire JSP.

I have a column which is number and my variables are int and I use setInt function of preparedstatement.
0
 
Ajay-SinghCommented:
can you post the code?
0
 
CEHJCommented:
>>I mean it have enter charachter and also comma.

>>I have a column which is number and my variables are int

Those two statements are incompatible
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now