This discussion is archived
1 Reply Latest reply: Jul 17, 2008 11:49 PM by 843849 RSS

Connecting to DB2 database

843849 Newbie
Currently Being Moderated
I am trying to connect to DB2 UDB 8.2 database with a mobile device (Symbol MC70).
Are there any other ways connecting to the database (compatible with mobile devices) except using DriverManager class(which is not supported by all kinds of mobile java platforms) and DataSource class (which for some reason doesn't work)? Do I have to include some kind of special jar file in my project, that would allow me to connect to DB2 database?

Datasource Example (not working):
//DB2DataSource db2Source = new DB2DataSource();
DB2SimpleDataSource db2Source = new DB2SimpleDataSource();
db2Source.setUser("User");
db2Source.setPassword("Pass");
db2Source.setDatabaseName("Test");
db2Source.setDriverType(4);
db2Source.setPortNumber(Port);
db2Source.setServerName(ip);
Connection conn = db2Source.getConnection();
conn.close();

Errors in the Websphere device developer 5.6:
The project was not built since its classpath is incomplete. Cannot find the class file for javax.naming.Referenceable. Fix the classpath then try rebuilding this project.


Thanks
  • 1. Re: Connecting to DB2 database
    843849 Newbie
    Currently Being Moderated
    Hi ZRC,

    I am new in J2ME and I have the same problem. I have tried to connect to Java DB. It did not connect at all, but friend of mine gave me advice when I build the source code of the sql classes to make a jar next time to use SDK1.4. I have not tried yet, but it has sense for me. I hope to help you. Sorry if not.

    Regards,
    tron_79