Hi again everybody.
I really wanna get to the bottom of this.

I posted a ticket
http://code.google.com/p/android/issues/detail?id=5437
and, perhaps as expected, the reply sounded:

"this code is undocumented because
 it's unsupported. please do not use
 undocumented API."

The ticket has been closed but I am still
not satisfied.

I understand that the driver doesn't have to be
documented if you're not supposed to be using
it since it's going "low-level".

But the driver does not seem to register itself,
without Class.forName("SQLite.JDBCDriver"),
I get "no suitable driver found".

So that means we're not supposed to be using
the sqlite back-end through JDBC at all? I'm
not happy! Why is the JDBC built-in if no one is
allowed to use it?

----
jotobjects:
I have had several projects where you have to
invoke the driver (using Class.forName) to
have it register itself. This seems to be the
common convention. You don't see the driver
in DriverManager.getConnection() - but the
driver will link to a certain url.



On Dec 14, 11:34 pm, jotobjects <jotobje...@gmail.com> wrote:
> JDBCdrivers are never used directly byJDBCapplications. In aJDBC
> application you reference the URI name of the driver in
> DriverManager.getConnection().  That is the only time you ever see the
> driver and you never actually call a method on the driver itself in 
> aJDBCapplication.  This has nothing to do with Android. It is just
> part ofJDBC.
>
> On Dec 14, 5:29 am, kristianlm <kristianl...@gmail.com> wrote:
>
> > Hi jotobject,
> > I don't understant why this wouldn't be part of the public API. if
> > Android is shipped with aJDBCdriver, why not let people use it? It's
> > certainly useful for many of us!
>
> > Kris
>
> > On Dec 12, 10:42 pm, jotobjects <jotobje...@gmail.com> wrote:
>
> > > On Dec 8, 10:41 pm, Joerg Pleumann <joerg.pleum...@gmail.com> wrote:> 
> > > Regarding android.jar, I never checked but I could imagine that it
> > > > contains only the public API classes and might even have the actual
> > > > bytecode erased. Nothing is ever run against it. It is just there to
> > > > make Javac or Eclipse happy (somebody please correct me if I'm wrong).
> > > > On the device, the driver should be part of /system/framework/
> > > > core.jar.
>
> > > The SQLite driver is never used by the public API.  You pass the name
> > > as a String URI "jdbc:sqlite:" to getConnection().  That is the way
> > >JDBCalways works. The drivers are not part of the public API so the
> > > documentation is NOT missing anything regarding drivers.
>
> > > As far as I can see the only missing documentation is the URI
> > > "jdbc:sqlite:" as in Joerg's example -
>
> > >             String db = "jdbc:sqlite:" + getFilesDir() + "/test.db";
> > >             Class.forName("SQLite.JDBCDriver");
> > >             Connection conn = DriverManager.getConnection(db);
>
> > > The Class.forName() call is only necessary if Android does not
> > > automatically register the driver with DriverManager (I don't know if
> > > it does or not).

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to