This discussion is archived
3 Replies Latest reply: Aug 21, 2009 3:59 AM by 843849 RSS

mssql connection with j2me cdc

843849 Newbie
Currently Being Moderated
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?

Thanks
  • 1. Re: mssql connection with j2me cdc
    843849 Newbie
    Currently Being Moderated
    yes of course, JSR169 is there !


    have a look,
    http://jcp.org/en/jsr/detail?id=169
    http://java.sun.com/javame/reference/apis/jsr169/

    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
    843849 Newbie
    Currently Being Moderated
    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.setPortNumber(1433);
    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.

    Thanks,

    Byron
  • 3. Re: mssql connection with j2me cdc
    843849 Newbie
    Currently Being Moderated
    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