Please, help me(on MySql forum told me that it isnt a MySQL issue):
"Did you ensure that you added the user to the MySql database?"
Yes I do.
"Next, if you did add the user and it isn't working, what exact error are you receiving. The error is an indication of the issue occurring."
I can run my app on Struts just once(first time)
When I close my browser and I want to run my app again, I receive the connection error
The error:
"
Error al crear el ResultSet: No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error: ** BEGIN NESTED EXCEPTION ** com.mysql.jdbc.exceptions.jdbc4.CommunicationsException MESSAGE: Communications link failure Last packet sent to the server was 0 ms ago. STACKTRACE: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago. at sun.reflect.GeneratedConstructorAccessor101.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance..............
.............
"
"Another point would be what exact program are you using to connect? Each program is slightly different and this is useful to know if you want someone to troubleshoot the issue."
My code is:
protected Statement _statement;
protected ResultSet _rs;
private static String protocolo = "jdbc:mysql://localhost/";
private static String driver = "com.mysql.jdbc.Driver";
private static String dbname = "mydb";
private static String user = "myuser";
private static String password = "mypwd";
private boolean DEBUG = false;
public static Connection conn = null;
public DBService () {
}
/**
* Carga el driver para la base de datos
* y hace la conexion a la base de datos
*/
public static void conectaDB () throws DBException {
if (conn == null){
try{
Class.forName(driver);
conn = DriverManager.getConnection(protocolo + dbname, user, password);
}
catch (Exception ex){
System.out.println("EN obtenoiendo el conn ERROR");
System.out.println("connecting error");
if (ex instanceof DBException) {
throw new DBException("EEEerror AL CONECTARSE A LA BD EN------!"+ex.getMessage());
}
throw new DBException ("(2)Error al conectarse a la base de datos!!!!....");
}
}
}
...........more.......
(

I have to use JSP/servlets instead of Struts?)
Thanks a lot in advance