Giter Club home page Giter Club logo

jeedemo's Introduction

This very short note is about how to:

  • start HSQLDB (TCP server, in memory mode) and its simple GUI client
  • add Connection Pool to said HSQLDB server and define appropriate jdbc JNDI resource in GlassFish 3.1
  • add Hibernate support to GlassFish 3.1

Clone this project and run database server and (optional) simple GUI client

  1. clone or update this project (obvious)
  • cd to the project folder (do this with any other terminal)
  • chmod 755 ./scripts/*.sh
  • run HSQLDB server (TCP, in memory mode):
    ./scripts/runHSQLDBServer.sh
  • run HSQLDB GUI Client (optional but strongly recommended)
    ./scripts/runHSQLDBClient.sh

Define Connection Pool and JNDI JDBC resource

  1. stop GlassFish if it's running
    asadmin stop-domain
  • copy jdbc driver hsqldb-2.2.4.jar to glassfish domain lib folder e.g.:
    cp ./scripts/hsqldb-2.2.4.jar /opt/devel/as/glassfish3/glassfish/domains/domain1/lib/ext/.
  • define resource connection pool and jndi resource. Edit default domain configuration file e.g.:
    vi /opt/devel/as/glassfish3/glassfish/domains/domain1/config/domain.xml
    Find <resource> element. Copy&Paste following xml fragment next to any other <jdbc-connection-pool> element:
    <jdbc-connection-pool driver-classname="" datasource-classname="org.hsqldb.jdbc.JDBCDataSource"
    res-type="javax.sql.DataSource" description="" name="HSQLPool" ping="true">
    <property name="DatabaseName" value="jdbc:hsqldb:hsql://localhost/workdb"></property>
    <property name="User" value="SA"></property>
    <property name="Password" value=""></property>
    <property name="connectionAttributes" value=";ifexists=true"></property>
    </jdbc-connection-pool>
    <jdbc-resource pool-name="HSQLPool" description="DataSource for demo apps with HSQLDB"
    jndi-name="jdbc/demoapps"></jdbc-resource>
  • start GlassFish
    asadmin start-domain
  • check out connection from inside GlassFish
  • open web console http://localhost:4848
  • click: Resources/JDBC/JDBC Connection Pools
  • click: HSQLPool
  • try Ping, it must Succeed !

Add Hibernate support to GlassFish

  • open web console http://localhost:4848
  • click: Update Tool
  • find and select Hibertate in Available Add-Ons
  • click Install
  • restart GlassFish asadmin restart-domain

Don't hesitate deploy & run project

  1. ./scripts/buildRedeploy.sh
  • http://localhost:4848/jeedemo

jeedemo's People

Contributors

kubaneumann avatar

Watchers

Robert Tomczak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.