SQL with Android
in
Android Processing
•
2 years ago
I'm trying to make a simple select from a table. When I compile it's working well, but when I compile in "Android mode" say: package de.bezier.data.sql does not exist.
Can you help me? Thanks very much.
Can you help me? Thanks very much.
- import de.bezier.data.sql.*;
MySQL msql;
void setup()
{
size( 400, 400 );
background(255, 204, 0);
//Connection
String user = "userTest";
String pass = "abcdefg";
String database = "ddbbTest";
msql = new MySQL( this, "localhost", database, user, pass );
if (msql.connect()){//if connection OK
msql.query("SELECT * FROM ddbbTable");//Select data
int i=100; //var position
while (msql.next ()) {//while data
text(msql.getInt(1), 100, i);//get data
i+=20;//position increase
println( "ID: " + msql.getInt(1) );//print data
}
}else{//if connection KO
println("connection failed !");//print msg
}
}
3