I've deploy my .war file in Openshift with Tomcat 6 (JBoss EWS 1.0). Everything goes well until the app tries to connect with de MySQL DB.
I've search the info and I'm sure the info for my DB is:
- HOST: 127.12.143.2
- PORT: 3306
- DB_NAME: redsocial
So my connection code is as follow:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class GestorDeConexiones {
private final static String DRIVER_CLASS_NAME = "com.mysql.jdbc.Driver";
private final static String DRIVER_URL = "jdbc:mysql://127.12.143.2:3306/";
private final static String USER = "xxxxxx";
private final static String PASSWORD = "xxxxxx";
static {
try {
Class.forName(DRIVER_CLASS_NAME);
} catch (ClassNotFoundException e) {
e.printStackTrace(System.err);
}
}
private GestorDeConexiones() {}
public final static Connection getConnection() throws SQLException {
return DriverManager.getConnection(DRIVER_URL, USER, PASSWORD);
}
}
But always appears the same error: "No suitable driver found for jdbc:mysql://127.12.143.2:3306/redsocial"
When I deploy the app in Tomcat in a local way with "jdbc:mysql://localhost/redsocial" everything works perfectly.
¿Someone knows the solution?