Employee demo
This section shows small demo - employee application. You will find sample demo in downloaded
zip file or at least see screnshots screenshots
.
Installation and demo application
Download release from releasesAndDownloads
and unzip demo application. Seee readme/README.TXT , there you can find description for folders in zip archive. Now u can try the employee demo aplication running as plain server with spring or on JEE server. Application will have swing client and web client.
- Running as plain server with Spring :
- Run employee server : INSTALL_DIR/vpda-samples/emp/bin/runEmpPlain , ensure you use jdk 6 or JAVA_HOME is set to point to valid java 6.0 install directory
- Run swing client : INSTALL_DIR/vpda-swingClient/bin/run , ensure you use jdk 6.0 or JAVA_HOME is set to point to valid java 6.0 install directory. You can use RMI or HTTP protocol to connect.
- Run swing application using webstart technology. Open browser at http://localhost:8082/vpda-jnlp/vpda.jnlp or run webstrat launcher javaws http://localhost:8082/vpda-jnlp/vpda.jnlp
- Open browser at http://localhost:8082/vpda/ and use web application.
- When finished, kill server with CTRL+C
Now u can play with application, update data, use master detail (department - employee,projects), create new records. In usage
you will see there was not much code to write for all of this.
- Running on Glassfish. Same as running application in J2EE with Spring , we can run application on JEE server without Spring. We will use h2 database with data in memory. So no database installation will be needed.
- Install GlassFish. We have last tested with glassfish-installer-v2.1-b25 build.
- Create Connection Pool with name : vpdaH2MemPool and DataSource class name : org.h2.jdbcx.JdbcDataSource. Add properties to pool :
- url = jdbc:h2:mem:vpda;DB_CLOSE_DELAY=-1
- user = sa
- password = ""
- Create new jdbc resource for above created pool with jndiName = jdbc/vpdaH2Mem
- Deploy sample ear file to Glassfish server : INSTALL_DIR/vpda-samples/samples-emp/ear/samples-emp-server-ear-version.ear using GlassFish web console or command line
- Start Swing client and use RMI/HTTP protocol
- Open browser at http://localhost:8080/vpda/
Now you can again play with application running on GlassFish. You see application is same regardless running as J2SE application or JEE.