Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: To write special characters to Oracle thru JDBC

Re: To write special characters to Oracle thru JDBC

From: Joe <yohan1701_at_nospam.space.com>
Date: Fri, 16 Nov 2001 15:09:15 -0500
Message-ID: <MPG.165f3c79c1d6241f989741@news.bellglobal.com>


psst did you hear what Molnar Laszlo said
> Hi
>
> I want to write command statements to Oracle Database thru JDBC, Java. A
> problem is, that these
> statements contain special characters like ' & _ % ? . For example if
> this statement contains
> '&mm' than oracle think that i want to give a value to mm variable. How
> can i solve these
> problems if i don't want to find these special characters in these
> statements ? Do you know a simple but great solution?
>
>
> Thanks
> Laszlo Molnar
>
>

use a preparedStatement
PreparedStatement ps = conn.prepareStatement( "insert into tablename (columns) values( ? )" );
ps.setString( 1, stringwithabunchofcrapinit ); ps.executeUpdate();

-- 
Joe

"I bent my wookie" - Ralph Wiggum
Received on Fri Nov 16 2001 - 14:09:15 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US