In the last part of the command we give the resource a name. asadmin create-jdbc-resource -connectionpoolid MysqlConnPool jdbc/your_jdni To finish the file content we have the create-jdbc-resource command, used to configure a JNDI resource associated with the connection pool that was created before through the parameter connectionpoolid. asadmin create-jdbc-connection-pool -datasourceclassname .jdbc.MysqlDataSource -restype -property user=your_username:password=your_password:serverName=your_server_name:portNumber=3306:databaseName=ebdb:useSSL=false MysqlConnPool Here the name was set to “MysqlConnPool”. All properties are separated by colon.Īt the end of the command we provide the connection pool name. In my case I needed to disable SSL with useSSL=false. property: The database specific properties like user, password, portNumber, databaseName.restype: The connection pool resource type.datasourceclassname: The class name for a datasource inside Mysql lib.In the command below we create a jdbc connection pool inside glassfish for the application using create-jdbc-connection-pool command. asadmin start-domain domain1Īfter the lib download we call asadmin, the glassfish command line tool, using start-domain to start the default domain configured by the Elastic Beanstalk image which is called “domain1”. In the snippet above we are using curl to download the mysql jdbc connector from maven repository to Glassfish lib folder. curl -L -o /usr/local/glassfish5/glassfish/domains/domain1/lib/mysql-connector-java-8.0.13.jar Let’s see what the Docker file is doing command by command. # Install Datasource dependencies and configure datasource in Glassfish Note that each command needs to be separated by the string “
0 Comments
Leave a Reply. |