We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › cannot handle the exception or sql.connect failed
Page Index Toggle Pages: 1
cannot handle the exception or sql.connect failed (Read 346 times)
cannot handle the exception or sql.connect failed
Feb 17th, 2008, 7:39pm
 
My program tried to post up an error image if it found failed in mysql.connect (i.e return false) or any exception found related to java, however it is failed and it just only shows in the console area. (as my program will be run over day and night, and there may be connection or other type of problem found)

e.g of my code:

try {
       if ( msql.connect())
       {      
       } else {
        background(255);
       image(error, width/4, height/4);      
      }
    }  catch ( Exception e ) {
           background(255);
           image(error, width/4, height/4);        
   }

at the end my console area shown:
SQL.connect(): Could not connect to the database
java.sql.SQLException: null,  message from server:xxxxxxxxx
Re: cannot handle the exception or sql.connect fai
Reply #1 - Feb 22nd, 2008, 11:06am
 
msql.connect() should return false if connection failed, though.

can you post more code?
Re: cannot handle the exception or sql.connect fai
Reply #2 - Feb 22nd, 2008, 12:31pm
 
sorry missed your post.

i updated the library a couple of weeks ago because .connect() was always returning true .. so you should update to the latest version to kill that bug:
http://bezier.de/mysql/

F
Page Index Toggle Pages: 1