DataSources allow services and filters in XMS to use a named link to a particular datasource. The DataSource allows you to reference all the vendor specific connection settings, the driver, username, and password by using a simple name.
Because XMS Mail Server is built using java, database connections are handled through Java DataBase Connectivity or JDBC which means you can connect almost any database to XMS as a datasource. All you need is a JDBC driver (a .jar or .zip file that you will put in the plugin's directory).
All major Database Vendors provide a JDBC driver for their databases, even Microsoft.
There are several third party companies that provide commercial JDBC drivers, typically going with your database vendor's driver is the best bet, but in some cases you can get better performance or features out of third party drivers. Additionally there are also open source drivers for many databases.
You can go here to find a list of common jdbc drivers
If still have not found a JDBC driver for your database look at Sun's JDBC Driver Finder.
The JDBC Class name is a fully qualified java class name for the main database driver class. You can find this in your JDBC Driver's documentation. The driver class name typically starts with a com., net. or org. followed by the company domain, for example the JDBC driver class from mysql.com is called com.mysql.jdbc.Driver.
JDBC URL's point to a specific database on a specified database server. There is no standard for JDBC url's every JDBC driver uses a slightly different syntax. You can see this page for some examples.
A JDBC URL for a MySQL database using the com.mysql.jdbc.Driver direct from MySQL might look like this: jdbc:mysql://127.0.0.1/databaseName
A JDBC URL for a Microsoft SQL Server database using the open source jTDS driver (driver class: net.sourceforge.jtds.jdbc.Driver) might look like this: jdbc:jtds:sqlserver://127.0.0.1/databaseName
A JDBC URL for a PostgreSQL db using the org.postgresql.Driver direct from PostgreSQL might look like this: jdbc:postgresql://127.0.0.1/databaseName
Please consult your JDBC Driver documentation for more information about obtaining the JDBC url
Most drivers allow you to pass connection properties in thr url as well, see the driver documentation for more info on that.
In order for XMS to be able to find the JDBC driver class for your database, it must be within XMS's java classpath.
Download or obtain the driver files from your vendor, the jdbc driver is typically contained within a file with .jar as the extension. To install the driver, put the .jar file inside your plugins directory in the root directory of your XMS installation. During startup your driver will be automatically added to the java classpath, and thus installed as a JDBC driver.
Once you have installed your driver, found out the JDBC driver class name, and the JDBC url you can configure a datasource in XMS to be used by services and filters in XMS email server.
You can setup as many datasources as you like, but they all must be contained within on DataSourceService. The XMS Server datasource service is called xms.dataservices.XMSDataSourceService. Inside the service tag for the xms.dataservices.XMSDataSourceService you can have multiple datasource tags. Here's an example connecting to a Microsoft SQL Server database using the jTDS driver for SQL Server:
<service class="xms.dataservices.XMSDataSourceService">
<datasource name="myDataSource"
jdbcdriver="net.sourceforge.jtds.jdbc.Driver"
jdbcurl="jdbc:jtds:sqlserver://127.0.0.1/myDatabase"
username="username"
password="password" />
</service>