DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Database Bottlenecks Nobody Talks About: Optimizing SQL Queries Beyond Indexing
  • LangChain With SQL Databases: Natural Language to SQL Queries
  • Custom Model Context Protocol (MCP) for NL2SQL: A Rigorous Evaluation Framework on Oracle Database
  • Why Your "Stateless" Services Are Lying to You

Trending

  • How an AI Software Factory Works: From Developer Intent to Production
  • The Three Tiers of Agentic Incident Response: When to Trust AI Autonomy
  • Designing Frontend Applications for Failure, Not Just Success
  • PWA on iOS, Part 2: HTTPS, Manifest and Service Worker

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Databases
  4. JDBC Connection Pool In Payara Using phpMyAdmin (MySQL)

JDBC Connection Pool In Payara Using phpMyAdmin (MySQL)

In this article, we will learn how to create a JDBC connection pool in PHPMyAdmin.

By 
Hitanshi Mehta
·
Jun. 28, 19 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
13.1K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

Introduction

In this article, we will learn how to create a JDBC connection pool in phpMyAdmin.

Step:1

Go to the database and create a new database. (I have created a database and table for your reference, you can use your own database and tables.)  

Step:2

In StudentDB, create a table tblStudent.

Step:3

Generate the structure of the table.

Step:4

For opening the Payara server, we have two options.

1) Go to netbeans>Services>Payara server>View Domain Admin Console

2) Go to any web browser (chrome, firefox, etc.)>Enter URL>http://localhost:4848/

(By default, the port number for Payara is 4848. If you have changed the port number of Payara Server, then use that port number)

Step:5

Once Payara is open, go to Resources>JDBC>JDBC connection pool>New   

Step:6

Pool Name: You can provide any name.

For Resource type and Database Driver Vendor, you need to check the version: MySQL-connector-java.

A path for MySQL -connector-java: (path where you have installed the payara) >payara5>glassfish>domains>domain1>lib

If a version of MySQL-connector-java is less than 8, then use:

Resource Type: javax.sql.DataSource

Database Driver Vendor: MySql

If the version of MySQL-connector java is 8 or higher then use:

Resource Type: javax.sql.PoolDataSource

Database Driver Vendor: MySql

Once you click next, the second textbox of Database Driver Vendor will become writable.

In second textbox of DatabaseDriver Vendor write: com.mysql.cj.jdbc.MysqlDataSource.

Don't forget to check Introspect. It will give a long list of the property, but not checking introspect will give an error during ping.  

Step:7

Click next and scroll down. There will be a long list of properties for which you have to set the following property.

We need to add one property:

1) driverClass: com.mysql.jdbc.Drive.

You can sort property for faster access using two triangles. (Highlighted in the screenshot).

2) Password: It is your phpMyAdmin password (Setting password is compulsory. If your phpMyAdmin has a null password, set a password of phpMyAdmin.)

3) User: It is a username of phpMyAdmin.

4) Port: Port number of phpMyAdmin. In most cases, it is 3306.

5) ServerName: It is phpMyAdmin serverName.

6) DatabaseName: Provide a database name for which you are creating a connection pool.

7) URL: You can manually specify a URL or, as an alternative, you can perform steps 8 and 9.    

Step: 8 (Optional)

Go to netbeans>services>Database>MysqlServer>Right click>connect

Step: 9 (Optional)

Select the database>Right click>connect.

One URL for a specific database will be created.

Copy until the name of the database and paste it into the URL, Url, url property.

Step:10

Once all properties are set, click finish.

Click Save>New value successfully saved message will be shown.

Click ping>Ping succeeded.

Ping succeeded means a connection pool is created successfully. 

Step:11

Once the connection pool has succeeded, create a new JDBC resource>new.   

Step:12

JNDI Name: Provide any JNDI name. Pool Name: Select the pool we have created. Click OK.

A connection pool has been created! If you have any doubts or questions, feel free to ask in the comments section!

Connection pool PhpMyAdmin Connection (dance) Database MySQL

Opinions expressed by DZone contributors are their own.

Related

  • Database Bottlenecks Nobody Talks About: Optimizing SQL Queries Beyond Indexing
  • LangChain With SQL Databases: Natural Language to SQL Queries
  • Custom Model Context Protocol (MCP) for NL2SQL: A Rigorous Evaluation Framework on Oracle Database
  • Why Your "Stateless" Services Are Lying to You

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook