Compatibility Layer for J2SE

66 views
Skip to first unread message

Jim Redman

unread,
May 15, 2012, 1:49:34 PM5/15/12
to sqld...@googlegroups.com
I have a compatibility layer that let SQLDroid run on J2SE. It
recreates the Android classes, Cursor, SQLiteDatabase, etc.

The sqlite calls are made through JNA using the SQLite class from here:

https://github.com/gwenn/sqlite-jna/blob/master/src/main/java/org/sqlite/SQLite.java

I haven't done more than basic testing, but if anyone wants to give it a
try I can either Push the code or provide a zip for testing.

I created a "Quick Start" page in the Wiki and a few tests.

Damodar, if you can replicate the problem you see in a test case, either
on Android or using the compatibility layer, I may have a chance to take
a look.

Thanks,

Jim

--
Jim Redman
(505) 662 5156 x85
http://www.ergotech.com

Uwe Kubosch

unread,
May 15, 2012, 3:11:42 PM5/15/12
to <sqldroid@googlegroups.com>, Kristian Lein-Mathisen
This sounds great! I think we should add this to the SQLDroid organization.

Kristian, do you mind if I add Jim and Damodar to the SQLDroid team on GitHub so they get access to add this project and update the code base?
--
Uwe Kubosch
Systems Developer
Datek Wireless AS
u...@datek.no
http://datek.no/


Uwe Kubosch

unread,
May 15, 2012, 3:15:58 PM5/15/12
to <sqldroid@googlegroups.com>, Kristian Lein-Mathisen
Damodar: What is your GitHub username?

Uwe Kubosch

unread,
May 15, 2012, 3:33:47 PM5/15/12
to <sqldroid@googlegroups.com>, Kristian Lein-Mathisen
Found it: dperiwal right?

Kristian Lein-Mathisen

unread,
May 15, 2012, 6:07:19 PM5/15/12
to Uwe Kubosch, <sqldroid@googlegroups.com>

Hey guys!

I though Jim and Damodar were team members already! They're more than welcome!

K.

Damodar Periwal

unread,
May 15, 2012, 9:04:38 PM5/15/12
to sqld...@googlegroups.com
Jim,

That sounds interesting.  I am wondering how it would be different from some other already available SQLite JDBC drivers like SQLiteJDBC – Xerial – Trac or  Zentus's SQLite JDBC driver.

Regarding "replicate the problem you see in a test case", do you mean the problem in concurrent connections I mentioned sometime back?

Kristin and Uwe, I am already a tem member (dperiwal, dper...@gmail.com).

Thanks,

-- Damodar

Jim Redman

unread,
May 16, 2012, 12:13:34 AM5/16/12
to sqld...@googlegroups.com
Damodar,

On 05/15/2012 07:04 PM, Damodar Periwal wrote:
> Jim,
>
> That sounds interesting. I am wondering how it would be different from
> some other already available SQLite JDBC drivers like/SQLiteJDBC
> <http://goog_1773703410>/� Xerial � Trac
> <http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC>or Zentus's SQLite
> JDBC driver <http://www.zentus.com/sqlitejdbc>.

Xerial is an extension of Zentus. The JNA code that I used is also part
of a JDBC Driver:

https://github.com/gwenn/sqlite-jna

The code in specifically place in the Public Domain so no licensing issues.

None of these, as far as I can tell, support blobs. Blobs are really
useful for storing photos, and since most Android devices have cameras
being able to store and retrieve images is important. Since our product
allows users to build and test everything on J2SE and then deploy it all
to Android (and/or to an Applet), not having blobs on J2SE was becoming
a problem.

The Xerial/Zentus driver also has a problem with time/date columns - I
haven't researched what, but I know that code we have the works with
everything else (MySQL, Oracle, DB2, JTDS, HSQLDB, SQLDroid, etc. etc.)
doesn't work with the Xerial driver.

So it was either debug one of these or create the compatibility layer.
Since SQLDroid is a known entity I figured I'd go for extending that.
I'm sure there are performance issues and lurking bugs, but in fact,
except that whoever wrote the metadata code used all sorts of bizarre
Cursors, it's a fairly thin layer.

JNA means that there's no JNI code to support specifically for SQLDroid.
There is native code associated with JNA, but I suspect that they
support almost as many platforms as SQLite.

>
> Regarding "replicate the problem you see in a test case", do you mean
> the problem in concurrent connections I mentioned sometime back?

Yes.

>
> Kristin and Uwe, I am already a tem member (dperiwal, dper...@gmail.com
> <mailto:dper...@gmail.com>).

Does this mean that I'm going to learn to love git?

Jim

>
> Thanks,
>
> -- Damodar
>
> On Tue, May 15, 2012 at 10:49 AM, Jim Redman <jre...@ergotech.com
> <mailto:jre...@ergotech.com>> wrote:
>
> I have a compatibility layer that let SQLDroid run on J2SE. It
> recreates the Android classes, Cursor, SQLiteDatabase, etc.
>
> The sqlite calls are made through JNA using the SQLite class from here:
>
> https://github.com/gwenn/__sqlite-jna/blob/master/src/__main/java/org/sqlite/SQLite.__java
> <https://github.com/gwenn/sqlite-jna/blob/master/src/main/java/org/sqlite/SQLite.java>
>
> I haven't done more than basic testing, but if anyone wants to give
> it a try I can either Push the code or provide a zip for testing.
>
> I created a "Quick Start" page in the Wiki and a few tests.
>
> Damodar, if you can replicate the problem you see in a test case,
> either on Android or using the compatibility layer, I may have a
> chance to take a look.
>
> Thanks,
>
> Jim
>
> --
> Jim Redman
> (505) 662 5156 x85 <tel:%28505%29%20662%205156%20x85>
> http://www.ergotech.com

Uwe Kubosch

unread,
May 18, 2012, 2:55:03 AM5/18/12
to Kristian Lein-Mathisen, <sqldroid@googlegroups.com>
They should both have commit access now. Welcome!

Uwe Kubosch

unread,
May 18, 2012, 3:02:35 AM5/18/12
to <sqldroid@googlegroups.com>

On 2012-05-16, at 07:13, Jim Redman wrote:

>> Kristin and Uwe, I am already a tem member (dperiwal, dper...@gmail.com
>> <mailto:dper...@gmail.com>).
>
> Does this mean that I'm going to learn to love git?
>
> Jim

Yes :) It took me a while, but there are benefits.
Reply all
Reply to author
Forward
0 new messages