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

前端 未结 5 1885
盖世英雄少女心
盖世英雄少女心 2020-12-19 06:11

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.

相关标签:
5条回答
  • 2020-12-19 06:26

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

    0 讨论(0)
  • 2020-12-19 06:29

    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.

    0 讨论(0)
  • 2020-12-19 06:34

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

    0 讨论(0)
  • 2020-12-19 06:39

    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

    0 讨论(0)
  • 2020-12-19 06:41

    Good tutorial sqljdbc-tut

    Latest driver (in tech preview) is sqljdbc-jars

    0 讨论(0)
提交回复
热议问题