apache james 邮件服务器连接数据库
1,找到<users-store>标签 将下边的这种文件存储方式注释 <repository name="LocalUsers" class="org.apache.james.userrepository.UsersFileRepository"> <destination URL="file://var/users/"/> </repository> 把下边的数据库存储方式的注释打开或者新增 <repository name="LocalUsers" class="org.apache.james.userrepository.JamesUsersJdbcRepository" destinationURL="db://maildb/users"> <sqlFile>file://conf/sqlResources.xml</sqlFile> </repository> 2,找到<data-source name="maildb"这一行修改成以下内容 <data-source name="maildb" class="org.apache.james.util.dbcp.JdbcDataSource"> <driver>oracle.jdbc.driver.OracleDriver</driver> <dburl>jdbc:oracle:thin:@192.168.1.1:1521:test</dburl> <user>test</user> <password>test</password> <keep-alive>select 1 from dual</keep-alive> <testOnBorrow>true</testOnBorrow> <testOnReturn>true</testOnReturn> <max>50</max> <poolPreparedStatements>true</poolPreparedStatements> </data-source> 3,找到<inboxRepository> 将下边的这种文件存储方式注释 <inboxRepository> <repository destinationURL="file://var/mail/inboxes/" type="MAIL"/> </inboxRepository> 把下边的数据库存储方式的注释打开或者新增 <inboxRepository> <repository destinationURL="db://maildb/inbox/" type="MAIL"/> </inboxRepository> 4,找到<spoolrepository 将下边的这种文件存储方式注释 <spoolrepository destinationURL="file://var/mail/spool/" type="SPOOL"/> 把下边的数据库存储方式的注释打开或者新增 <repository destinationURL="dbfile://maildb/spool/spool" type="SPOOL"/> 5,将相应驱动拷贝到james/lib/下
这样在你启动james时候就会在相应的数据库中创建表结构,本例中使用的是oracle,也可以用其他数据库
(前提是你的james已经成功运行)
相关推荐
Kafka 2020-09-18
Wepe0 2020-10-30
杜倩 2020-10-29
windle 2020-10-29
minerd 2020-10-28
mengzuchao 2020-10-22
Junzizhiai 2020-10-10
bxqybxqy 2020-09-30
风之沙城 2020-09-24
kingszelda 2020-09-22
大唐帝国前营 2020-08-18
yixu0 2020-08-17
TangCuYu 2020-08-15
xiaoboliu00 2020-08-15
songshijiazuaa 2020-08-15
xclxcl 2020-08-03
zmzmmf 2020-08-03
newfarhui 2020-08-03
likesyour 2020-08-01