I have a big problem using the default SQLite database via JDBC driver.I would like to use ORMLite with this.Let me expose my code:

String databaseUrl = "jdbc:sqlite:/data/data/my.package.name/db.sqlite";

                Class.forName("SQLite.JDBCDriver");
        	DriverManager.getConnection(databaseUrl);
        	
        	dataSource = DatabaseTypeUtils.createSimpleDataSource(databaseUrl);
        	databaseType = DatabaseTypeUtils.createDatabaseType(dataSource);
			databaseType.loadDriver();
			
			UpDao = new UserProfileJdbcDao(databaseType);
			UpDao.setDataSource(dataSource);
			UpDao.initialize();

I downloaded the ormlite2.8.jar (src) and modified the SqliteDatabaseType class so that the private final static String DRIVER_CLASS_NAME = "SQLite.JDBCDriver" .
However when I imported all of the classes from the ormlite2.8.jar(src) , I found errors concerning the logger, specifically the CommonsLoggingLog and Log4jLog classes.Someone advised my to write my own Logger class that uses the Android logger , but I do not know how to do that.
This is the ORMLite I am using for Android : http://ormlite.sourceforge.net/sqlite_java_android_orm.html


I am highly appreciating any help.
Thank you in advance.

Regads, Andrew

As of version 3.X of ORMLite, it supports native calls to the Android database API calls. No more reliance on the unsupported JDBC classes. Please try the lastest version (4.2) and send mail to the mailing lists if you need any help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.