I want to access Microsoft SQL Server Compact Edition databases from Java. How can I do that? I searched for JDBC driver for SQLCE, but I didn't find any.
The Microsoft SQL Server JDBC Driver does not support connecting to SQL Server Compact. At this time there isn't a scheduled JDBC support for SQL Server Compact edition. Thank-you for your continuing support of SQL Server.
Sincerely, Jimmy Wu
Search for the SqlJDBC4 library. I know a coworker uses it.
While I'm not familiar with SQL Server CE, I presume that MS provides an ODBC driver for it. Although it is not recommended for production use, you can use the JDBC-ODBC bridge to make your connection.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:<yourODBC_DSN>");
To reiterate, the JDBC-ODBC Bridge driver provided with JDBC is recommended only for development and testing, or when no other alternative is available.