You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Mi...@shell.com on 2007/07/31 12:48:40 UTC

Connection Refused - Database Not Found

Hi,

I'm new to Java, JSP, Eclipse, Derby and Tomcat but have a strong background in software development so shouldn't be this stuck ...

I'm working through the Eclipse tutorial 'Creating Database Web Applications with Eclipse'.  Here's a summary of my configuration:

JSP code for JSTL tags says:  <sql:setDataSource dataSource="jdbc/SampleDB">
context.xml has a Resource tag with name="jdbc/SampleDB" and url="jdbc:derby://localhost:1527/SAMPLE"
Data Source Explorer confirms that Derby contains a DB called SAMPLE.
SQL File Editor can connect to the SAMPLE DB and update it.

When I run my JSP page, I get the following error:  The connection was refused because the database SAMPLE was not found.

Running Eclipse 3.3.0, Tomcat 6.0.13 and Derby 10.2.2 on JDK 1.6.0.
Appreciate any help you can give me.

Mike


Re: Connection Refused - Database Not Found

Posted by Stanley Bradbury <St...@gmail.com>.
Mike.May@shell.com wrote:
> Hi,
>
> I'm new to Java, JSP, Eclipse, Derby and Tomcat but have a strong background in software development so shouldn't be this stuck ...
>
> I'm working through the Eclipse tutorial 'Creating Database Web Applications with Eclipse'.  Here's a summary of my configuration:
>
> JSP code for JSTL tags says:  <sql:setDataSource dataSource="jdbc/SampleDB">
> context.xml has a Resource tag with name="jdbc/SampleDB" and url="jdbc:derby://localhost:1527/SAMPLE"
> Data Source Explorer confirms that Derby contains a DB called SAMPLE.
> SQL File Editor can connect to the SAMPLE DB and update it.
>
> When I run my JSP page, I get the following error:  The connection was refused because the database SAMPLE was not found.
>
> Running Eclipse 3.3.0, Tomcat 6.0.13 and Derby 10.2.2 on JDK 1.6.0.
> Appreciate any help you can give me.
>
> Mike
>
>
>   
Often this problem is because the default directory being used by 
Network Server (NS) does not contain the database (in this case 
SAMPLE).  If you start Network Server while cd'd to the directory 
containing SAMPLE or specify 'java -Dderby.system.home=<dir-with-SAMPLE> 
...'  on the command line starting Network Server then NS will be able 
to find the DB with the URL you are using.


Re: Connection Refused - Database Not Found

Posted by sablassville <e9...@gmail.com>.
Hi 
I had same problem.  Funny we are both working thru the same tutorial.

I solved it with
url="jdbc:derby://localhost:1527/home/rick/DerbyDatabases/MyDB" in the
context.xml file.

This is the database location from the Data Source Browser.

Regards
Rick



Mike.May wrote:
> 
> Hi,
> 
> I'm new to Java, JSP, Eclipse, Derby and Tomcat but have a strong
> background in software development so shouldn't be this stuck ...
> 
> I'm working through the Eclipse tutorial 'Creating Database Web
> Applications with Eclipse'.  Here's a summary of my configuration:
> 
> JSP code for JSTL tags says:  <sql:setDataSource
> dataSource="jdbc/SampleDB">
> context.xml has a Resource tag with name="jdbc/SampleDB" and
> url="jdbc:derby://localhost:1527/SAMPLE"
> Data Source Explorer confirms that Derby contains a DB called SAMPLE.
> SQL File Editor can connect to the SAMPLE DB and update it.
> 
> When I run my JSP page, I get the following error:  The connection was
> refused because the database SAMPLE was not found.
> 
> Running Eclipse 3.3.0, Tomcat 6.0.13 and Derby 10.2.2 on JDK 1.6.0.
> Appreciate any help you can give me.
> 
> Mike
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Connection-Refused---Database-%3Cdb%3E-Not-Found-tf4192277.html#a12006217
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: Connection Refused - Database Not Found

Posted by sablassville <e9...@gmail.com>.
Ignore my previous post.  That is how I was able to get ij to connect.

I named my database Feedback, instead of Sample.  It's location is
/home/rick/DerbyDatabases/MyDB.
1.  I stopped the Derby Network Server (right mouse click on Feedback,
Apache Derby, Stop Network Server).
2.  Feedback Properties, Apache Derby.  (right mouse click on Feedback,
Properties, choose Apache Derby from the pop-up)
3.  Changed Derby System Properties - derby.system.home to
/home/rick/DerbyDatabases
4.  Finally it worked.





Mike.May wrote:
> 
> Hi,
> 
> I'm new to Java, JSP, Eclipse, Derby and Tomcat but have a strong
> background in software development so shouldn't be this stuck ...
> 
> I'm working through the Eclipse tutorial 'Creating Database Web
> Applications with Eclipse'.  Here's a summary of my configuration:
> 
> JSP code for JSTL tags says:  <sql:setDataSource
> dataSource="jdbc/SampleDB">
> context.xml has a Resource tag with name="jdbc/SampleDB" and
> url="jdbc:derby://localhost:1527/SAMPLE"
> Data Source Explorer confirms that Derby contains a DB called SAMPLE.
> SQL File Editor can connect to the SAMPLE DB and update it.
> 
> When I run my JSP page, I get the following error:  The connection was
> refused because the database SAMPLE was not found.
> 
> Running Eclipse 3.3.0, Tomcat 6.0.13 and Derby 10.2.2 on JDK 1.6.0.
> Appreciate any help you can give me.
> 
> Mike
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Connection-Refused---Database-%3Cdb%3E-Not-Found-tf4192277.html#a12007489
Sent from the Apache Derby Users mailing list archive at Nabble.com.