bilal haider <bilalhaide...@gmail.com> writes:

> Hi i want to establish a connection with an existing db posdb.
>
>                 url = "jdbc:derby://" + "localhost" + ":" + "1527" + "/" +
> "posdb"; 
>               new ClientDriver();
>               Connection connection = null; 
>               try {
>
>                       connection = DriverManager.getConnection(url, "sa", 
> "123");
>                       return true;
>               
>               }
>               catch(Exception e)
>               {
>                       System.out.println(e.getMessage());
>                       return false;
>               }
> Exception:
> The application server rejected establishment of the connection.  An attempt
> was made to access a database, posdb, which was not found.

Hi Bilal,

Is the network server running in the same directory as where posdb is
located? If not, either start the network server in posdb's parent
directory, or point the system property derby.system.home to that
directory. As an alternative, you could specify the full path to posdb
in the URL. Something like jdbc:derby://localhost:1527//path/to/posdb.

Hope this helps,

-- 
Knut Anders

Reply via email to