最近接手了一个离职同事的老项目,全是XML配的,看的我贼难受,不过了解下配置原理还是有好处的
1.MySql
<Resource name ="cockpitTest" auth="Container" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://192.168.***.***:3306/databasename?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8" username="root" password="123456" maxActive="30" maxIdle="10" maxWait="10000" />
2.Oracle
<Resource name ="bigdataOrJndi" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@192.168.**.**:1521:databasename" username="root" password="123456" maxActive="30" maxIdle="10" maxWait="10000" />
3.hive
<Resource name ="getNearestAirport" auth="Container" type="javax.sql.DataSource" driverClassName="org.apache.hive.jdbc.HiveDriver" url="jdbc:hive2://192.168.***.**:10000/databasename" username="root" password="123456" maxActive="30" maxIdle="10" maxWait="10000" />