db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Wen <we...@mail.com>
Subject Re: establishment of the connection
Date Mon, 14 Mar 2011 07:20:45 GMT

 Hi,

1. why not use 

 url = "jdbc:derby://localhost:1527/posdb";
 but cocat literal substrings.

2. make sure the database posdb has been created and derby network server is started.

3. make sure you did not change the port number of derby.

 

-----Original Message-----
From: bilal haider <bilalhaider86@gmail.com>
To: derby-user@db.apache.org
Sent: Mon, Mar 14, 2011 2:30 pm
Subject: establishment of the connection



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.

-- 
View this message in context: http://old.nabble.com/establishment-of-the-connection-tp31141466p31141466.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


 

Mime
View raw message