+1  A: 

Have you tried SQL Server Management Studio Express?

You can access SQL Server Compact 3.5 databases stored on a smart device or on the desktop computer by using SQL Server Management Studio in SQL Server or SQL Server Management Studio Express (SSMSE). http://technet.microsoft.com/en-us/library/ms172037.aspx

As for the JDBC Driver, you could take a look at this one, provided by Microsoft. I don't know if it works with the Compact Edition or if you already tried it, but I thought it was worth mentioning.

Bruno Gomes
+1  A: 

1- There isn't a JDBC driver and at time of writing, MS has no plans to create one.

2- There isn't a ODBC driver, so the next obvious answer (JDBC to ODBC bridge) won't help you.

3- Some JDBC vendors claim to be able to connect to 'any oledb' data source, so that is yoru most likely best bet-- link, but it won't necessarily be free.

MatthewMartin
+1  A: 

Try jTDS, it's a free software JDBC driver for SQL Server and Sybase.

http://jtds.sourceforge.net/

Chochos
Its too bad jtds doesnt support a sqlce database. I guess that would be some complex jni stuff though... so it makes sense it wouldn't.
djangofan
+1  A: 

JDBC driver uses TCP/IP connection. The compact edition most likely cannot listen on TCP/IP port 1433. Compact Edition is meant to be accessed by an application which has loaded the .dlls necessary to talk to it. It's meant for Visual Studio projects.

You need to uninstall compact edition and install SQL Express 2005/2008 instead. After installation enable the "sa" account, give it a password, enable SQL+NT authentication, and then enable the TCP/IP listener to listen on port 1433 (the default port).

Then, finally, you can connect with JDBC. Jtds is a JDBC3.0 driver and therefore requires JDK1.6+ . I prefer using the Microsoft 2005 JDBC2.0 driver.

djangofan
+1  A: 

There is a free program called SQLCeEditor that does it.

I'd still like a JDBC driver though since that would make it easy to use with Eclipse and Java.

djangofan
+1  A: 

Use SDF Viewer to explore your .SDF database file, can also import/export data, script and work with tables, indexes and foreign keys.

howard
A: 

hi! i'm searching for a j2me's driver to work wiht SQL SERVER COMPACT EDITION . i'm from Venezuela. i need your help! excuse my english! i'm working in windows mobile 5.0 and Java2 micro edition. i need find some help. do you have some idea about that?

Diego