db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cgloyd <cgl...@tamzen.com>
Subject New to Derby: Modifying Single User App to Server/Client
Date Mon, 23 Nov 2009 18:12:54 GMT

I'm attempting to modify a Java desktop application (with embedded Derby)
into a server/client configuration and I'm having trouble getting the client
to connect to the server.  I've been trying to follow the examples in
SimpleNetworkServerSample.java and SimpleNetworkClientSample.java but since
I'm new to both networking and Derby, I'm not sure I'm doing it correctly. 
For testing, I created an executable for the server and am running the
client from Eclipse 3.4.  I'm using Derby 10.5.3.

When I start the server, it appears to be working correctly.
Server Code:
	try {    		
	    NetworkServerControl server = new NetworkServerControl
    	} catch (Exception e){

Client Code:

Properties props = System.getProperties();
props.put("derby.system.home", "C:/Apache/");
props.put("user", "user");    	 
props.put("password", "pw");

try {
        	Connection conn =
} catch(SQLException ex) {
            System.out.println("\n ------- SQL Exception");
             while (ex != null) {
                System.out.println("Message: " + ex.getMessage()+ex);
                System.out.println("Error Code: " + ex.getErrorCode());
                ex = ex.getNextException();

When I try to connect, I get the error below.  This is just a sampling of
the error (the actual error is very long):

------- SQL Exception
Message: A connection could not be established because the database name
'MyDatabase;java.runtime.name=Java(TM) SE Runtime
HotSpot(TM) Client
Pack 3;java.vm.specification.name=Java Virtual Machine Specification;
is larger than the maximum length allowed by the network protocol.
Error Code: 40000

I did a test case where I didn't start the server, ran the client code and
got a "server not found" error.

Thanks in advance,

View this message in context: http://old.nabble.com/New-to-Derby%3A-Modifying-Single-User-App-to-Server-Client-tp26483214p26483214.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

View raw message