Netbeans + Visual Paradigm = EJB Tutorial (Part 4)

Based on the previous parts of this tutorial (1, 2, 3) we will modify the application and Glassfish to connect to PostgreSQL or Oracle as DB.

  • Preparing Glassfish libraries
    Download the drivers for Oracle and PostgreSQL and add them to your {GLASSFISHHOME}/domains/{YOURDOMAIN}/lib
    Restart Glassfish.

    Glassfish lib folder

  • PostgreSQL DB
    I run the DB on a virtual box instance with the hostname vcb3
    Port: 5432
    User: demo
    (set setting searchpath to myschema)
    Password: demo
    DB: demo
    Schema: myschema
  • Create the JDBC pool and resource for PostgreSQL
    This step can be skipped when we start our application from Netbeans, necessary configurations will be set automtically.

    JDBC Connection Pool

    JDBC Connection Pool

    JDBC Resource

  • Datasource in demoejb

    Data Source

    Data Source

    Data Source

    Data Source

    Data Source

  • Run the application
  • Oracle DB
    I run Oracle 10g Express on a virtual box instance with the hostname vcb3b
    Port: 1521
    User: myschema
    Password: demo
    DB SID: XE
  • Add datasource

    Data Source

    Data Source

    Data Source

    Data Source

    Data Source

  • Run the application
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s