Re: problem with jdbc url and query in jsp code
- From: Lew <lew@xxxxxxxxxxxxx>
- Date: Thu, 18 Oct 2007 07:01:33 -0400
RedGrittyBrick wrote:
K Gaur wrote:hello everybody
i tried the following jsp code to query cloudscape db :
<snip>
String jdbcurl="jdbc:derby:C:\Program Files\IBM
\Cloudscape_10.0\frameworks\NetworkServer\bin\projdb";
<snip>
and tomcat returned this:
An error occurred at line: 15 in the jsp file: /CloudscapeDemo/bb.jsp
Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \
\ )
15: String jdbcurl="jdbc:derby:C:\Program Files\IBM
\Cloudscape_10.0\frameworks\NetworkServer\bin\projdb";
somebody please tell what's wrong with it.
I suspect you nead to read about Strings a bit more. The character "\" is a *special* character. In other words, a metacharacter. If you want to include "\" as an ordinary character in a string, you need to "escape" it to remove its specialness. Try replacing each "\" with "\\".
Besides, URLs use forward slashes.
--
Lew
.
- References:
- problem with jdbc url and query in jsp code
- From: K Gaur
- Re: problem with jdbc url and query in jsp code
- From: RedGrittyBrick
- problem with jdbc url and query in jsp code
- Prev by Date: Re: problem with jdbc url and query in jsp code
- Next by Date: Re: date operations in jpql queries
- Previous by thread: Re: problem with jdbc url and query in jsp code
- Index(es):