To run the NsSample program, follow these steps.
java org.apache.derby.tools.sysinfoThis command shows the Derby jar files that are in the classpath as well as their respective versions.
java nserverdemo.NsSampleIf the program runs successfully, you will receive output similar to the following:
Using JDBC driver: org.apache.derby.jdbc.ClientDriver Derby Network Server created Apache Derby Network Server started and ready to accept connections on port 1621 [NsSample] Derby Network Server started. [NsSample] Sample Derby Network Server program demo starting. Please wait ..................... Connection number: 2. [NsSampleWork] Begin creating table - SAMPLETBL and necessary indexes. [NsSampleClientThread] Thread id - 2; started. [NsSampleWork] Thread id - 2; requests database connection, dbUrl =jdbc:derby://localhost:1621/NSSampledb;create=true; [NsSampleClientThread] Thread id - 1; started. [NsSampleWork] Thread id - 1; requests database connection, dbUrl =jdbc:derby:NSSampledb; [NsSampleWork] Thread id - 1; inserted 1 row. [NsSampleWork] Thread id - 1; inserted 1 row. [NsSampleWork] Thread id - 1; deleted 1 row with t_key = 9372 [NsSampleWork] Thread id - 1 selected 1 row [920,Derby50 ,951.7808,9216] [NsSampleWork] Thread id - 1 selected 1 row [920,Derby50 ,951.7808,9216] [NsSampleWork] Thread id - 1; inserted 1 row. [NsSampleWork] Thread id - 1 selected 1 row [920,Derby50 ,951.7808,9216] [NsSampleWork] Thread id - 1; deleted 1 row with t_key = 9216 [NsSampleWork] Thread id - 1 selected 1 row [824,Derby26 ,8.802546E22,9155] [NsSampleWork] Thread id - 1; updated 1 row with t_key = 9155 [NsSampleWork] Thread id - 1; closed connection to the database. [NsSampleClientThread] Thread id - 1; finished all tasks. [NsSampleWork] Thread id - 2; updated 0 row with t_key = 9372 [NsSampleWork] Thread id - 2; updated 1 row with t_key = 9155 [NsSampleWork] Thread id - 2 selected 1 row [56,Derby26 ,8.802546E22,9155] [NsSampleWork] Thread id - 2; inserted 1 row. [NsSampleWork] Thread id - 2; updated 1 row with t_key = 9155 [NsSampleWork] Thread id - 2; deleted 1 row with t_key = 9155 [NsSampleWork] Thread id - 2 selected 1 row [785,Derby2 ,0.30170244,8280] [NsSampleWork] Thread id - 2 selected 1 row [785,Derby2 ,0.30170244,8280] [NsSampleWork] Thread id - 2; updated 1 row with t_key = 8280 [NsSampleWork] Thread id - 2 selected 1 row [59,Derby2 ,0.30170244,8280] [NsSampleWork] Thread id - 2; closed connection to the database. [NsSampleClientThread] Thread id - 2; finished all tasks. [NsSample] Shutting down network server. Apache Derby Network Server - shutdown [NsSample] End of Network server demo.