Professional Documents
Culture Documents
Creating DS Payara
Creating DS Payara
7. Click on “New”
8. Type a name for the new JDBC connection pool. Select javax.sql.
DataSource as ‘Resource Type’ and MySQL as ‘Database vendor’.
9. In the field ‘DataSource ClassName’ write as an alternative to the
default displayed by default:
com.mysql.cj.jdbc.MysqlConnectionPoolDataSource.
17.Click OK to finish
Now you can obtain a connection with the DataSource using this code
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;
. . .
public Class . . .
@Resource (mappedName=”TIWDS”)
DataSource ds;