Some confusion surrounding JDBC Resources and JDBC Connection pools Glassfish
NickName:LuckyLuke Ask DateTime:2011-10-15T03:35:07

Some confusion surrounding JDBC Resources and JDBC Connection pools Glassfish

I am about to make a connection to my database and I am using EJB and JPA. I have recently started doing these technologies so I have some problems understand it all at this point:) I know that the persistence.xml is needed in order to use JPA. It is the file where I configure how to connect to the database, that I know. However it seems like there are multiple ways of doing it.

What would be the difference (or when should I even use the one alternative over the other?) of defining properties such as username, database, password etc. in the persistence.xml file and in Glassfish? Advantages/disadvantages if any.

Underneath on the image I posted I have JDBC Resources and JDBC Connection Pools. I am a litte confused about the terminology of the two. Why don't we add properties such as username, database, password and so on in the JDBC Resources? Could someone explain the difference between them and what they mean?

JDBC Resources

A JDBC resource (data source) provides applications with a means of connecting to a database. Typically, the administrator creates a JDBC resource for each database accessed by the applications deployed in a domain. (However, more than one JDBC resource can be created for a database.) http://download.oracle.com/docs/cd/E19316-01/820-4335/ablih/index.html

I think it strange that we add such properties on the pool but not in the resource, but I probably misunderstand the concepts.

enter image description here

Copyright Notice:Content Author:「LuckyLuke」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/7772678/some-confusion-surrounding-jdbc-resources-and-jdbc-connection-pools-glassfish

More about “Some confusion surrounding JDBC Resources and JDBC Connection pools Glassfish” related questions

Some confusion surrounding JDBC Resources and JDBC Connection pools Glassfish

I am about to make a connection to my database and I am using EJB and JPA. I have recently started doing these technologies so I have some problems understand it all at this point:) I know that the

Show Detail

Saving Glassfish JDBC Configuration

I recently had to re-install Glassfish 3.1.2 from scratch and I found myself spending way too much time re-configuring the JDBC Connection Pools and Resources (copy/paste from another source was no...

Show Detail

Glassfish 5 Error while adding JDBC Connection pools

I am trying to install and run an application on Glassfish version 5. I downloaded it from here. I am using jdk1.8.0_231, I have tried multiple times but it does not let me add any resource. It even

Show Detail

lookup a JDBC resource on glassfish with JNDI

Generally speaking, how is a persistence.xml in a library configured to use JDBC Connection Pooling with EclipseLink and JPA? When the library is used by the web module of an Enterprise Applicatio...

Show Detail

Comparing Glassfish Connection Pool With Other Connection Pools

Has anyone done any benchmarking comparing the glassfish connection pool with other fast jdbc connection pools like BoneCP or Tomcat 7 jdbc pool? I am exploring out ways to create the glassfish

Show Detail

How to change jdbc-connection-pool properties dynamically at glassfish-resources.xml?

Basically I have two enviroments which run my Application, I use the preconfigured Docker enviroment on AWS to deploy my applications. So, it gets the connection properties by the glassfish-resourc...

Show Detail

Monitoring JDBC connection pools

I'm connecting my Java application via JDBC driver and Tomcat configurations. I used this class to define my configurations. But sometimes, I got following exceptions: com.mysql.jdbc.exceptions.

Show Detail

Glassfish Runtime Exception on JDBC Connection Pools

I have just finished installing my oracle jar to glassfish library and successfully connect by ping and JDBC Pool to my database with the right property values. Then I chose it for my JDBC Resources

Show Detail

How to temp disable jdbc-resource/connection-pool (glassfish-resources.xml)

I've got an Java EE Web app. I am using this to manage users in a database, so they can login. The thing is the the productowner wants a option to login without using the DB, I have already made th...

Show Detail

Glassfish doesn't create JDBC Resources

I'm trying to create JDBC Connection Pool and JDBC Resource using glassfish-resources.xml with code below. I've tried to do it with Glassfish 4.0, 4.1, 4.1.1 and Payara. I know there was a problem ...

Show Detail