Skip to main content

New Article: Getting Started with Java and SQLite on Blackberry OS 5.0

Posted by editor on March 18, 2010 at 5:57 AM PDT

We've just published a new article by Java Champion Bruce Hopkins, Getting Started with Java and SQLite on Blackberry OS 5.0. I've long thought about how "computers" are "disappearing" into devices -- just as 100 years ago, that great new technology, the motor, also began to "disappear" into devices that were powered by motors. The general public doesn't consider a smart phone (or even a "dumb" one) a computer, but of course all mobile phones are computers. We developers know that. And where there's a computer, why not a database?

In his article, Bruce demonstrates how to create and manage an SQLite database on a Blackberry phone running Blackberry OS 5.0. Now, in considering why I call mobile phones computers, you have to remember that I once paid $3500 for a Tandy 1000 HD desktop that came with a whopping 256 Kbytes of memory and a 10 Mbyte hard drive (hence, the "HD"), plus two (yes, you heard that right) 5 1/4 inch floppy drives, a Centronics printer port, and also an RS-232 serial port (or maybe two). That was a great machine, especially after I purchased the 384 KByte memory card that brought the total memory up to the MS-DOS 640 KByte limit!

No, seriously, that was a great machine! It lasted usefully for many, many years! My son played his first computer games on that machine. I developed some pretty intense mathematical modeling software (using Hewlett-Packard's Rocky Mountain BASIC) on that machine. It was a cool machine, incredibly durable! Thank you, Radio Shack.

Ummm... but... today? Yeah (getting back to present-moment reality), today, give me a Blackberry phone running Blackberry OS 5.0. Know what? Blackberrys that can run OS 5.0 don't cost anywhere near $3500! Does anyone want to suggest to me that we haven't made unforethinkable progress with computing and devices and their pricing in the past few decades?

Still... if you're accustomed to working in a data center running an Oracle (my situation), or MySQL, or SQL Server, or PostgreSQL, or whatever database, on its own server, accessible from all attached clients via a wide variety of means... don't expect to find that when you run SQLite on a Blackberry OS 5.0 phone. You are in a different world, with respect to hardware resources.

For example, want to use JDBC? Sorry. Still, as Bruce says:

If you’re wondering if the Blackberry SQLite Java API is JDBC compliant, let me clarify that it’s not. The JSR-169 API (JDBC API for Java ME) has been standardized for years, but unfortunately, there are no commercially available mobile phones that support database development with it. Please note, however, that although the Blackberry SQLite Java API doesn’t support the JSR-169 API, the basic concepts relating to programmatic access to the database are still the same.

So, to implement your SQLite database on a Blackberry, you do have to adopt a different point of view -- you have to work at a different level from what you may be accustomed to. Still, a lot is possible. You really can develop applications that utilize a database on Blackberry phones!

Probably the biggest headache with a database on such a small device is the lack of visibility into the database -- the connectivity we're accustomed to isn't really there, because the database is almost like embedded software.

In his article, Bruce shows that this situation can be addressed through the development of new tools. He presents DButility.java, an application that enables you to:

navigate the filesystem of your device to debug database creation issues, as well as to easily determine the file size of your embedded database.

Running a database managed by Java on a mobile phone? Yes, it's quite do-able. Read Bruce's Getting Started with Java and SQLite on Blackberry OS 5.0 to see how easily it can actually be accomplished.

If that doesn't seem easy to you, I'll see if I can find an old Tandy 1000 for you to program on. Mine's long gone -- sorry!


In Java Today, Matt Raible, who is at TheServerSide Java Symposium, writes about James Gosling's keynote address in What's Happening in the Java World?:

This morning at TheServerSide Java Symposium I attended James Gosling's keynote. Below are my notes from his talk. The unifying principle for Java is the Network - it ties everything together. Enterprise, Desktop, Web, Mobile, HPC, Media and Embedded. The most important thing in the Java world is the acquisition of Sun by Oracle. James is showing a slide of Duke in a fish tank with a "Snorcle!" title above it. Obligatory statistics for Java...

Michael Pontacoloni posted News: James Gosling what Oracle-Sun means for Java (Video):

Here is a short video of James Gosling discussing what impact he believes Oracle's acquistion of Sun will have on the Java language. He says it has been an interesting transition but that Oracle is commited to Java and the Java ecosystem. This is from the 2010 TheServerSide Java Symposium in Las Vegas.

Geertjan Wielenga discovered Biochemical Network Simulation on the NetBeans Platform:

Yet another NetBeans Platform application in the list of bioinformatics applications on the NetBeans Platform is... drumroll... BioNessie: "BioNessie is a free, state-of-the-art platform-independent BIOchemical NEtworks Simulation and AnalySIs Environment." Clearly, it is an application on the NetBeans Platform...


In the Weblogs, Markus Karg says Pimp Your GlassFish: Replacing XSL transformer in GF v2ur2:

There are times when things hurt so much that you feel urged to blog about them once solved. This is one of them. Our company is using XSL heavily for reporting (generating vector charts in PDFs on the fly from data analyzed by GlassFish), so it is not very amazing that we found some bugs in the XSL transformer (a.k.a "JAXP Implementation") contained in GlassFish. As we're not so fast as we would like to be, "our" GlassFish (actually there are dozens, as we are an ISV providing GF to our customers) still is v2ur2, but not v3 yet. So it is not surprising...

Kohsuke Kawaguchi invites San Francisco, CA area people to the Hudson Hackathon this weekend:

If you are living in San Francisco bay area, or if you are visiting the area for EclipseCon next week, make sure to come to Hudson Hackathon this Friday 3/19 and/or Saturday 3/20. The plan is to meet up, hang out, chat, hack code, and have fun. If you are planning to attend, please RSVP by leaving your name on Wiki. We planned this for two days, so that people doing Hudson for work can come Friday during their business hours, and people doing Hudson outside work can come Saturday without conflicting with day job commitments...

Juliano Viana is investigating JPA in the Clouds:

A big part of  my current company work is related to managing infrastructure hosted in cloud computing environments.I have recently released an open source project ( Rain Toolkit ) to help ease the management of Amazon EC2 objects. It is a set of command-line tools for performing day-to-day administration tasks. Since Rain Toolkit deals with the management of EC2 resources, it seemed only natural that it should store its data on Amazon SimpleDB. SimpleDB offers a rest-based API that I planned to use, but then I came accross simplejpa...


In the Forums, cdev asks about LWUIT Button Colouring: Hello. I'm developing an app in Netbeans 6.8 using LWUIT, and I've run into an issue with one of my forms. The form has a button object that I would like to be able to toggle the background colour of, but I cannot seem to make this work. Strangely, I can...

In the GlassFish WebTier forum, jweight has questions about [JSF 2] JSR-303 class level validators: I've got field level validation working with the reference implementation of JSR-303 (hibernate-validation-4.0.2.GA). I was able to validate a field with a @Size(min=3, max=10) annotation. I implemented a class level validator as...

walec51 finds it Imposible to add a class library jar to Glassfish: Hello, I've spend an entire day trying to make glassfish v3 or my ear app to see a third party jar. I've added it ot the web, ejb and ear projects in netbeans 6.8. I've added it to the directories...


Our Spotlight this week is the Jersey 1.1.5.1 release:

We have just released version 1.1.5.1 of Jersey, the open source, production quality, reference implementation of JAX-RS. The JAX-RS 1.1 specification is available at the JCP web site and also available in non-normative HTML here...


Our current java.net Poll asks Is the software engineering job market improving? The poll will be open until Friday.


We've just published a new Feature Article, Getting Started with Java and SQLite on Blackberry OS 5.0 by Java Champion Bruce Hopkins -- learn how to create applications that utilize SQLite on Blackberry OS 5.0. We're also featuring Dibyendu Roy's Rethinking Multi-Threaded Design Principles; in the emerging multicore/multiprocessor world, multi-threaded programming is critical, in my view. And in Has JDBC Kept up with Enterprise Requirements?, Jesse Davis invites us to look beyond Type 4 architecture to address the latest requirements of the enterprise Java ecosystem.


Current and upcoming Java Events:

Registered users can submit event listings for the java.net Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.


Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of java.net it will be archived along with other past issues in the java.net Archive.

-- Kevin Farnham

O'Reilly Media
Twitter: @kevin_farnham