Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
10.0.2.0, 10.0.2.1, 10.1.1.0
-
None
Description
The SimpleApp.java demo program supplied with Derby currently accepts two arguments and will soon (see JIRA entry: DERBY-247) accept a third that allows the application to run as a client to Network Server. Only 'embedded' is documented in the ${DERBY_INSTALL}/demo/simple/example.html file. The others should be added. The current undocumented argument is:
'jccjdbcclient' - will use the JCC client driver to access Network Server
The new argument might be:
'derbyclient' - will use the Net client driver to access Network Server
This brief description of the program using the derby client might help in this update:
To use the SimpleApp in client mode only the directory containing the SimpleApp and the netclient.jar file are needed in the CLASSPATH. By passing in 'derbyclient' as an argument the program will load the client driver rather than start the Derby engine. The parseArguments() method (line 230) changes two key strings. The variables 'driver' and 'protocol' are set to the client driver values. With these new definitions the go() method loads the client driver at line 73 and creates the client URL at lines 93-94. With the variables expanded these lines will look like this:
line 76: Class.forName("org.apache.derby.jdbc.ClientDriver")
line 93-94: conn = DriverManager.getConnection("jdbc:derby://localhost:1527/"
+ "derbyDB;create=true", props);
As in the embedded example the connection will create the database if it does not exist and boot derbyDB if it has not already been loaded by the Network Server. Note that the application is well behaved and does not shutdown the database when operating as a client.