JBoss Wildfly 20에 Database(Mysql) 연결 - (3)
페이지 정보
본문
[root@wildfly20 ~]# cd $WILDFLY_HOME/standalone/configuration/standalone.conf ==== <datasources> <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}"> <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url> <driver>h2</driver> <security> <user-name>sa</user-name> <password>sa</password> </security> </datasource>
<datasource jndi-name="java:jboss/MySqlDS" pool-name="MySqlDS" enabled="true" use-java-context="true" use-ccm="true"> <connection-url>jdbc:mysql://localhost:8080/characterEncoding=utf-8&serverTimezone=UTC</connection-url> <driver>mysql</driver> <security> <user-name>root</user-name> <password>password</password> </security> </datasource>
<drivers> <driver name="h2" module="com.h2database.h2"> <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class> </driver> </drivers>
<drivers> <driver name="mysql" module="com.mysql"> <driver-class>com.mysql.cj.jdbc.Driver</driver-class> <xa-datasource-class>com.mysql.cj.jdbc.MysqlXADataSource</xa-datasource-class> </driver> </drivers> </datasources> ==== |
[root@wildfly20 ~]# cd $JBOSS_HOME/bin/ # 연결된 모든 datasource 확인 [root@wildfly20 ~]# ./jboss-cli.sh --connect --command="/subsystem=datasources:read-resource(recursive=true)" # 방금 추가한 datasource로 Connection 테스트 [root@wildfly20 ~]# ./jboss-cli.sh --connect --command="/subsystem=datasources/data-source=MysqlDS:test-connection-in-pool" |
- 이전글apache-jboss 연동 설정 21.08.19
- 다음글Wildfly 20에 Database(Mysql) 연결 - (2) 21.05.21
댓글목록
등록된 댓글이 없습니다.