The dbShards Analysis Driver is a JDBC driver that can be used with existing applications to log all JDBC API calls and SQL statements to disk without impacting application functionality or performance. The driver acts as a thin wrapper around an underlying vendor-specific JDBC driver such as the MySQL JDBC driver. The resulting log files can be submitted for analysis to determine if an application is “shard-safe”.
The dbShards Analysis Driver is simple to install. The driver is contained in a single jar file named dbshards-analyze-driver-with-dependencies.jar and this jar needs to be in the application or application server classpath along with the vendor-specific driver. We currently only support JDK 1.6 so you may need to upgrade . The next step is to change the application connection details.
Example Configuration
The following configuration extract from a Spring-based application shows typical connection details for a MySQL database.
<bean id="dataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://servername/dbname"/> <property name="username" value="user"/> <property name="password" value="password"/> </bean>
To change this configuration to use the dbShards Analysis Driver, the class name must be changed to the appropriate dbShards driver class name (there are specific classes for each supported database platform) and the URL must be modified so that is has a prefix of “jdbc:dbshardsAnalyze:” as shown in the following configuration extract.
<property name="driverClassName" value="com.dbshards.jdbc.logging.MySQLDriver"/> <!-- class name can be MySQLDriver, OracleDriver, SQLServerDriver, DB2Driver or JTDSDriver --> <property name="url" value="jdbc:dbShardsAnalyze:jdbc:mysql://servername/dbname"/>
Once the configuration is updated and the application is restarted, detailed information about the application’s interaction with the database will be recorded in a series of log files prefixed with “dbSAnalyze-” in the application’s current working directory.
Download
The dbShards Analysis Driver is a free download and is free to use. Please fill out the following form and you will receive the download URL by email.

