Recently i shared a post about Configuring and accessing MySQL jdbc driver on android application.
Good thing about MySQL is that it is open source and hence the driver is open source too. Even if we couldn’t find any android compatible driver, it wouldn’t be too difficult to get the source code and port it for android.
But when it comes to MSSQL and Sybase, its a different story. After successfully configuring Mysql JDBC driver I was looking for compatible drivers for MSSQL and unfortunately none of the versions available were compatible.
It was disappointing in start but then I started looking for some hacks around and came across a really wonderful library – jTDS JDBC Driver.
Now good things about this driver is that it is free software available under terms of GNU Lesser General Public License. Which means it is allowed to be used in open source as well as comercial projects.
Another good thing about this JDBC driver is that it supports both MSSQL and Sybase and it is compatible with Android.
jTDS is an open source 100% pure Java (type 4) JDBC 3.0 driver for Microsoft SQL Server (6.5, 7, 2000, 2005 and 2008) and Sybase (10, 11, 12, 15). jTDS is based on FreeTDS and is currently the fastest production-ready JDBC driver for SQL Server and Sybase. jTDS is 100% JDBC 3.0 compatible, supporting forward-only and scrollable/updateable ResultSets, concurrent (completely independent) Statements and implementing all the DatabaseMetaData and ResultSetMetaData methods. Check out the feature matrix for more details.
Quite a few of the commercial JDBC drivers out there are based on jTDS (or FreeTDS), even if they no longer acknowledge this. jTDS has been tested with virtually all JDBC-based database management tools and is the driver of choice for most of these (recommended for DbVisualizer and SQuirreL SQL, distributed with Aqua Data Studio and DataDino). jTDS is also becoming a common choice for enterprise-level applications: it passes both the J2EE 1.3 certification and Hibernate test suites, and is recommended for JBoss, Hibernate, Atlassian JIRA and Confluence and Compiere.
So go ahead and give it a shot.. It worked for me, I am sure you will enjoy working with it too..
PS: Have a look at FAQs before jumping into writing code.