How to use SQL Server Compact Edition (CE) from Java?

这一生的挚爱 提交于 2019-12-29 07:40:10

问题


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.


回答1:


According to a newsgroup post sent this Tuesday (2008-12-09) by Jimmy Wu@Mircrosoft:

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




回答2:


According to MSDN, there isn't one and there aren't any plans neither.




回答3:


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.




回答4:


Search for the SqlJDBC4 library. I know a coworker uses it.




回答5:


Good tutorial sqljdbc-tut

Latest driver (in tech preview) is sqljdbc-jars



来源:https://stackoverflow.com/questions/358318/how-to-use-sql-server-compact-edition-ce-from-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!