Re: problem with jdbc url and query in jsp code



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
.