1 message in com.googlegroups.android-beginnersRe: [android-beginners] MySQL in andr...
FromSent OnAttachments
Digit30 Mar 2008 20:13 
Subject:Re: [android-beginners] MySQL in android server
From:Digit (digi@gmail.com)
Date:03/30/2008 08:13:27 PM
List:com.googlegroups.android-beginners

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 <07.r@gmail.com> 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