3 Replies Latest reply: Aug 21, 2009 5:59 AM by 843849 RSS

    mssql connection with j2me cdc

      Is it possible to connect to mssql database from j2me cdc. Using Cr-eme jvm on a windows ce 5 device. Can I use the jdbc-odbc bridge driver? I tried adding this driver to my code and the only place I can find it is in rt.jar. I dont want to have to copy the whole jar to my ce device because it is rather large. Is there a way that I can just take out the odbc driver out?

        • 1. Re: mssql connection with j2me cdc
          yes of course, JSR169 is there !

          have a look,

          download JDBC Optional Package for CDC/Foundation Profile - Final Release (April 8, 2004) http://java.sun.com/products/jdbc/download.html

          • 2. Re: mssql connection with j2me cdc
            Maybe I am not understanding this correctly. With j2me cdc I have to connect to DB's using DataSource and not DriverManager. So for a mssql connection it would be:

            DataSource ds = new SQLServerDataSource();
            ds.setServerName("IP HERE");
            ds.setDatabaseName("DB name here");

            But whenever i try to run this I get an exception that javax.naming.Referenceable is not found, its not part of j2me cdc. I am using the mssql 2005 drivers 1.1

            Maybe I am way off track, any help would be greatly appreciated.


            • 3. Re: mssql connection with j2me cdc
              I am not sure for mssql.

              I am using JavaDB where EmbeddedSimpleDataSource is Derby's DataSource implementation for J2ME/CDC/Foundation

              Edited by: Pragun on Aug 21, 2009 10:59 AM