How to INSERT a newline character?

This is a discussion on How to INSERT a newline character? within the JDBC JAVA forums in Framework and Interface Programming category; Hi, I want to insert a multiline character string. Is there a special escape sequence for the newline charcters? (When I just stick in a new line character, my jdbc driver barks at me.) Many thanks in advance! Aaron...

Go Back   Application Development Forum > Framework and Interface Programming > JDBC JAVA

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 01-10-2006, 10:45 AM
aaronfude@gmail.com
Guest
 
Default How to INSERT a newline character?

Hi,

I want to insert a multiline character string. Is there a special
escape sequence for the newline charcters? (When I just stick in a new
line character, my jdbc driver barks at me.)

Many thanks in advance!

Aaron

Reply With Quote
  #2  
Old 01-10-2006, 11:14 AM
Joe Weinstein
Guest
 
Default Re: How to INSERT a newline character?



aaronfude wrote:

> Hi,
>
> I want to insert a multiline character string. Is there a special
> escape sequence for the newline charcters? (When I just stick in a new
> line character, my jdbc driver barks at me.)
>
> Many thanks in advance!
>
> Aaron
>


String foo = "blah, blah\nnew line...\n nother wefwefwef";

p = c.prepareStatement("insert into mytable values(?)");
p.setString(1, foo);
p.executeUpdate();

Reply With Quote
  #3  
Old 01-11-2006, 11:03 PM
aaronfude@gmail.com
Guest
 
Default Re: How to INSERT a newline character?


Joe Weinstein wrote:
> aaronfude wrote:
>
> > Hi,
> >
> > I want to insert a multiline character string. Is there a special
> > escape sequence for the newline charcters? (When I just stick in a new
> > line character, my jdbc driver barks at me.)
> >
> > Many thanks in advance!
> >
> > Aaron
> >

>
> String foo = "blah, blah\nnew line...\n nother wefwefwef";
>
> p = c.prepareStatement("insert into mytable values(?)");
> p.setString(1, foo);
> p.executeUpdate();


Apparently my "driver does not support this functionality". Is there
anything else I can do?

Thanks!

Reply With Quote
  #4  
Old 01-11-2006, 11:09 PM
Joe Weinstein
Guest
 
Default Re: How to INSERT a newline character?



aaronfude wrote:

> Joe Weinstein wrote:
>
>>aaronfude wrote:
>>
>>>Hi,
>>>
>>>I want to insert a multiline character string. Is there a special
>>>escape sequence for the newline charcters? (When I just stick in a new
>>>line character, my jdbc driver barks at me.)
>>>
>>>Many thanks in advance!
>>>Aaron

>>
>>String foo = "blah, blah\nnew line...\n nother wefwefwef";
>>
>>p = c.prepareStatement("insert into mytable values(?)");
>>p.setString(1, foo);
>>p.executeUpdate();

>
> Apparently my "driver does not support this functionality". Is there
> anything else I can do?
> Thanks!


Yow! What sort of failed-high-school-project of a JDBC driver
are you using? Sorry, I'm fresh out of ideas in that sort of
environment.
Joe Weinstein at BEA Systems

Reply With Quote
  #5  
Old 01-12-2006, 09:40 AM
aaronfude@gmail.com
Guest
 
Default Re: How to INSERT a newline character?

I'm using RmiJdbc.jar

I thought it was supposed to pretty good.

Can you recommend another for accessing and ODBC database (Access and
Excel).

Aaron

Reply With Quote
  #6  
Old 01-12-2006, 11:55 AM
Joe Weinstein
Guest
 
Default Re: How to INSERT a newline character?



aaronfude wrote:
> I'm using RmiJdbc.jar
>
> I thought it was supposed to pretty good.


I have been doing professional JDBC driver
development and support since '96. I have never
seen a driver that had not implemented simple
JDBC 1.0 prepared statements.

> Can you recommend another for accessing and ODBC database (Access and
> Excel).
> Aaron


I wish I could, but I don't no of any high-quality JDBC-ODBC bridge.
Sun's also sucks, but nowhere near as bad as that one...

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:00 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.