Interwork DB
1. JDBC Connection pool
a. JVM sent a session to DB to use a SQL
b. And then There will be made a Connection pool between JVM and DB
2. Config Connection pool
- Context.xml
<Resource name="jdbc/test" auth="Container" type="javax.sql.DataSource"
maxActive="50" maxIdle="30" maxWait="10000"
username="mysqluser" password="mysqlpassword"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/testdb"/>
3. JDBC Driver
- We have to set up a JDBC Driver
a. setenv
#JDBC Driver Classpath
CLASSPATH=/app/lib/jdbc.jar
b. lib
CATALINA_HOME/lib/jdbc.jar
4. JNDI Look up
a. context.xml
<Resource name="jdbc/test" ..../>
b. web.xml
<resource-ref>
<res-ref-name>jdbc/text</res-ref-name>
<res-type>javax.sql.DataDource</res-type>
<res-auth>Container</res-auth>
</resouce-ref>
c. java source
ds = ctx.lookup("java:comp/env/jdbc/test")
5. Tomcat + Spring + Mybatis?
a. context.xml
b. app.propertes
c. context-datasource.xml(JNDI Config)
d. context-sqlmap.xml
e. sql-ers-map-config.xml
'WAS > Tomcat' 카테고리의 다른 글
[Tomcat] 1. 설치환경 및 설치 (2) | 2017.08.20 |
---|---|
[Tomcat] 7.Host (0) | 2016.04.25 |
[Tomcat] 5. Batch - Parallel deployment (0) | 2016.04.24 |
[Tomcat] 4. Batch (0) | 2016.04.22 |
[Tomcat] 3. Config (0) | 2016.04.21 |