Thursday, August 30, 2012

Configure JNDI DataSource for OracleDB in GlassFish Server

In this article will see how to "Configure JNDI DataSource for Oracle in GlassFish 3.2 Server".

Login to Glassfish admin console in browser window, Once its open, in the left-hand side panel under Resources, click on JDBC and then JDBC Connection Pools. In the right hand-side click on new button will open the "New JDBC Connection Pool" window, enter the details as shown in below image.


Note: To store, organize, and retrieve data, most applications use relational databases. Java EE applications access relational databases through the JDBC API. Before an application can access a database, it must get a connection. JDBC resources provide applications with a means to connect to a database.

Clicking on Next button will display as shown in below image.


In same "New JDBC Connection Pool" window, in Additional Property section add the properties details as shown in below image.


Click on ping to test if the pool is created successfully. If not successful, check all the properties again.


Now under Resources, click on JDBC and then JDBC Resources. In the right hand-side click on new button will open the "New JDBC Resource" window, enter the details as shown in below image.

5 comments:

  1. Hi! one question. How i can encrypted password my database

    ReplyDelete
    Replies
    1. Para encriptar el password se tiene que ir a Domain -> Password Aliases pestaña, y ahí se crea nuestro password (todo en minúscula) el cual se almacena en el keystore del domain y luego ser usado en Resources -> JDBC -> JDBC Connection Pools
      en el atributo Password "{passAlias}" donde el passAlias es el nombre de nuestro alias que tiene asociado el password.
      Fin

      Delete
    2. Thanks Ivan.

      Translation for above reply :-

      To encrypt the password will have to go to Domain -> Password Aliases tab, and there it creates our password (all lower case) which is stored in the keystore of the domain and then use in Resources -> JDBC -> JDBC Connection Pools Password attribute in "{passAlias​​}" where is passAlias ​​alias name that is associated with our password.

      Delete
    3. After creating connection pool, how to configure jdni property in hibernate with oracle

      Delete
  2. Hi,

    Following link may help - Storing Passwords in an Oracle Database -http://www.oracle-base.com/articles/9i/storing-passwords-in-the-database-9i.php

    - Deepak

    ReplyDelete