No suitable driver found for jdbc

Fermé
samiapirou Messages postés 112 Date d'inscription dimanche 16 juin 2013 Statut Membre Dernière intervention 11 novembre 2015 - 30 oct. 2015 à 13:19
bonsoir
svp j'ai fait un programme pour la connexion de matlab avec le jdbc mais il m'affiche une erreur :
"no suitable driver found for jdbc:mysql://localhost:3306""


pouvez m'aider a résoudre ce problème est ce qu'il faut ajouter quelque chose a matlab une solution svp coici le code que j'ai fait:

host = 'localhost :3306' ;
user = 'root' ;
password = `' ;
% data base name
dbname = `mydb' ;
% jdbc parametrs
jdbcString=sprintf(`jdbc :mysql://%s/%s' , host, dbName)
jdbcDriver = `com.mysql.jdbc.Driver' ;
%path to maysql connector
javaaddpath(`mysql-connector-java-3.1.12-bin.jar')
% make the database connection object
dbConn= database(dbName ,user , password, jdbcDriver,jdbcString) ;
% chek if the connection is OK
dbStatus=isconnection(dbconn) ;
if(dbStatus==0)
msg=sprintf(`No valide DB Connection could be established. \nReason :%s',dbConn.Message)
msgbox(msg) ;
return
end
%fetch data from mysql
QUERY='SELECT * FROM mytable'
rs=fetch(dbConn,QUERY)
If(isempty(rs))
msgbox(`No data exist.....') ;
return
end
close(dbConn) ;



merci
A voir également: