Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: To write special characters to Oracle thru JDBC
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 WiggumReceived on Fri Nov 16 2001 - 14:09:15 CST
![]() |
![]() |