Hi all.
I have put derby client.jar into doman1/lib dir.
I createe the connectiom pool using the name of datasource implementatiin of derby.
Type: javax.Datasource
org.apache.derby.jdbc.ClientDataSource40
I added the properties of user, port, server, URL
locahost:1527/Sample
User app
Password app
Port 1527
Server localhost
But when i use the resource name for invece the datasource intoy server, i get into payara log that the class Is not found.
But the derby client.jar Is already present into domain1/lib.
I have triedany times but Is not working.
Mauro.
Greetings Mauro,
Here are the steps to set up a Derby JDBC connection pool and resource in the Payara Server.
-
Place the Apache Derby DB driver derbyclient.jar in ${PAYARA_HOME}/glassfish/domains/domain1/lib.
-
Restart the Payara Server after placing the jar.
-
Create JDBC Connection pool by providing the following properties :
- Pool Name : “DerbyTestPool”
- Resource Type: “javax.sql.DataSource”
- Database Driver Vendor: “Derby”
- Datasource Classname : “org.apache.derby.jdbc.ClientDataSource40” or “org.apache.derby.jdbc.ClientDataSource” (Select or enter vendor-specific classname that implements the DataSource)
In the additional properties section, specify the user, password, portNumber, databaseName, serverName(Host name or IP address of the database server)
-
Ping the pool to test the connection.
-
Create a JDBC Resource (Resources → JDBC → JDBC Resources) by providing the JNDI Name (example - “jdbc/DerbyClient”) and pool name (“DerbyTestPool” or whatever you named it)
-
You can now use this JDBC Resource in your application using
@Resource(lookup = “jdbc/DerbyClient”)
private DataSource ds;
Hope this helps!
Thanks & regards
Ramya
Yes It work. I added all.files of derby
Not only the derbyclient.jar and derbytools.jar .
Also the derbyshared.jar and other jars from derby lib.
I created the datasource into web.xml .
I used the web.xml from the payara example named datasource.
Now i have a problem with load Data from SQL file into META-INF.
Into persitence.xml
I added this property
<property name="jakarta.persistence.sql-load-script-source" value="META-INF/sql/data.sql" />.
When i deploy the war and start the web app the tables are created but the insert from the data.sql not worked.
The tables are empty.
Please help me.
Do you have a project working from GitHub ?
Mauro
Anither thing.
From log of payara server i read that the Entities not are weaved.