Hmmmm, there is no JDBC driver code distributed with Android. and there is
no MySQL database server running in the system too.
why do you think this could work ?
(for the record, Android provides you with SQLite, which is very different
from MySQL)
On Sun, Mar 30, 2008 at 7:45 PM, rahul <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I am trying to write a piece of code on the server (where the client
> can upload data). I want to use MySQL database for the same. However i
> am getting an error while trying to connect. The error is:
> DEBUG/dalvikvm(616): Exception Ljava/lang/ClassNotFoundException; from
> PathClassLoader.java:205 not caught locally
> DEBUG/dalvikvm(616): NOTE: loadClass 'com.mysql.jdbc.Driver'
> 0x40069960 threw an exception
>
>
> My code snippet is as follows:
>
> void open()
> {
> Log.d("entering***" , "&&&&&&&");
> try {
> try{
> Class.forName("com.mysql.jdbc.Driver").newInstance();
> }catch (Exception g) {Log.d("after forname " , " $$$$$$");
> g.printStackTrace();}
> Log.d("entering55555555555" , "&&&&&&&");
>
> Conn = DriverManager.getConnection("jdbc:mysql://localhost/
> test","rahul","gerrard");
> Log.d("entering" , "&&&&&&&");
> Stmt = Conn.createStatement();
> RS=Stmt.executeQuery("SELECT name,blog from android");
> int i=1;
> Log.d("HERE!!!! " , "I AM ");
> while (RS.next())
> {
> results.add(i + " : " + RS.getString(1) + " writes " +
> RS.getString(2));
> Log.d("results ::: ", RS.getString(1) + " " +
> RS.getString(2));
> }
> } catch (Exception e) {
> Log.d("ERROR%%%" , ":(:(:( " );
> e.printStackTrace(); }
> }
>
>
> any help would be appreciated...
> Thanks
> Rahul
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---