SQLibrary : Must specify port after ':' in connection string
in
Contributed Library Questions
•
1 year ago
Basicly i trie the MySQL_example1 from the SQLibrary to connect to a online database.
For in case it helps here is the default library:
- import de.bezier.data.sql.*;
- // created 2005-05-10 by fjenett
- // updated fjenett 20081129
- MySQL msql;
- void setup()
- {
- size( 100, 100 );
- // this example assumes that you are running the
- // mysql server locally (on "localhost").
- //
- // replace --username--, --password-- with your mysql-account.
- //
- String user = "root";
- String pass = "admin";
- // name of the database to use
- //
- String database = "bildwelt";
- // add additional parameters like this:
- // bildwelt?useUnicode=true&characterEncoding=UTF-8
- // connect to database of server "localhost"
- //
- msql = new MySQL( this, "localhost", database, user, pass );
- if ( msql.connect() )
- {
- msql.query( "SELECT COUNT(*) FROM image" );
- msql.next();
- println( "number of rows: " + msql.getInt(1) );
- }
- else
- {
- // connection failed !
- }
- }
- void draw()
- {
- // i know this is not really a visual sketch ...
- }
I get the following error:
- QL.connect(): Could not connect to the database ( jdbc:mysql://http://wp267.webpack.hosteurope.de/db--------------- ).
- java.sql.SQLException: Must specify port after ':' in connection string
I also tried with adding ":21" where it says "localhost" in the above example.
I'm not sure if it the port for the database is 21 as well but i would expect another error if 21 is wrong.
Someone experience/ideas?
1