Reputation: 1688
I'm trying to make connection from flex to java and from java to mysql. I managed to connect to java, but having error that class not found: com.mysql.jdbc.Driver. But I downloaded mysql.jar, included it added to library, and connection works when I testing it from eclipse scrapbook. Don't know what to do.
Class.forName("com.mysql.jdbc.Driver");
String username = "username";
String password = "password";
String database = "database"
String url = "jdbc:mysql://localhost/" + database;
connect = DriverManager.getConnection(url, username, password);
statement = connect.createStatement();
resultSet = statement.executeQuery(query);
SOLVED
Basically the solution was simple. Everybody keeps saying to put jar into lib folder, so I done it, but I wasn't realised that I have to put into my servers lib directory, not app lib directory and this miserable mistake cost so much.
In this particular situation I'm using red5, so I putted it into my red5 dist/lib directory and "surprisingly" it's started to work.
Upvotes: 1
Views: 368
Reputation: 1688
Basically the solution was simple. Everybody kept saying to put jar into lib folder, so that is what I did, but I didn't realise that I that I needed to put it into my servers lib directory, not the app lib directory and this miserable mistake cost so much. Anyway I hope this will help for some newbie like me.
In this particular situation im using red5, so I put it into my red5 dist/lib directory and "surprisingly" its started to work.
Upvotes: 1