Hallo everyone!

That's the (stupid ?) problem:
my connection works from a jsp page or from a servlet (tomcat and netbeans) but doesn't from a java application. I'm working in winXP professional and the mysql server is linux debian.

The application is started from a servlet by this code line

proc = runtime.exec(execCommand,environm);

This is the output returned to servlet:

Unable to connect to any hosts due to exception: java.net.SocketException: Unrecognized Windows Sockets error: 10106: create
java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.SocketException: Unrecognized Windows Sockets error: 10106: create
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:1797)
at com.mysql.jdbc.Connection.(Connection.java:562)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:361)
at java.sql.DriverManager.getConnection(DriverManager .java:512)
at java.sql.DriverManager.getConnection(DriverManager .java:171)
at Execute.readPerm(Execute.java:78)
at Execute.main(Execute.java:53)

and now the classic code line to connect i'm using:

Class.forName("org.gjt.mm.mysql.Driver");
con = DriverManager.getConnection(urlDB, user, pass);
stmt = con.createStatement();
rs = stmt.executeQuery(query);

line 78 is con = DriverManager.getConnection(urlDB, user, pass);