Tuesday, August 9, 2011

[android-developers] Re: Accessing PostGIS database from Android

You're missing a try catch for java.lang.ClassNotFoundException.

On Aug 8, 9:05 pm, alexbruy <alexander.b...@gmail.com> wrote:
> Hi all,
>
> I'm new to Android development and Java. Now I'm work on application
> that should interact with PostgreSQL (to be exact PostGIS) database. I
> read "Android & PostgreSQL" presentation by Mark Wong [1] and know
> that latest PostgreSQL JDBC driver (postgresql-9.0-801.jdbc.jar) works
> on Android.
>
> First I try to add external JAR in console because my PC is a bit slow
> for
> using Eclipse. As I understand from presentation, to use JDBC driver I
> should create .classpath file in the my ptoject directory and all will
> work.
>
> But when I try to build project with and I get next error:
>
> [javac] /home/alex/files/data/git/firereporter/src/com/nextgis/
> firereporter/ReportActivity.java:51: unreported exception
> java.lang.ClassNotFoundException; must be caught or declared to be
> thrown
> [javac]         Class.forName("org.postgresql.Driver");
> [javac]                      ^
> [javac] 1 error
>
> Here is my .classpath file
>
> <?xml version="1.0" encoding="UTF-8"?>
> <classpath>
>        <classpathentry kind="lib" path="/home/alex/devel/java/
> postgresql-9.0-801.jdbc4.jar"
> </classpath>
>
> I try to search how to do this, but all tips are related to Eclipse.
> Well,
> I install Eclipse and ADT plugin, then create new Android project and
> tried to add JAR as described in [2] and [3] but this also don't help.
> I get error on string
>
> Class.forName("org.postgresql.Driver");
>
> and project doesn't builds.
>
> Can anyone help me with this? May be I miss something or do it wrong?
>
> [1]http://www.pgcon.org/2011/schedule/events/278.en.html
> [2]http://groups.google.com/group/android-developers/browse_thread/threa...
> [3]http://www.youtube.com/watch?v=eY_uqi_qIz0
>
> Thanks,
> Alex

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate