Estoy programando una aplicacion Java con Eclipse de tipo JDBC.
El principal problema llega a la hora de conectar con la BBDD de MYSQL.
Cabe mencionar que la base de datos esta en un servidor en 1and1.com.
He probado con localhost con una BBDD mia...y funciona perfectamente.
No se si esque 1and1 veta mi conexion o que pasa.
Gracias de antemano.
me dice este error al compilar.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsExce ption: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:41 1)
at com.mysql.jdbc.SQLError.createCommunicationsExcept ion(SQLError.java:1116)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:344)
at com.mysql.jdbc.ConnectionImpl.coreConnect(Connecti onImpl.java:2333)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(Co nnectionImpl.java:2370)
at com.mysql.jdbc.ConnectionImpl.createNewIO(Connecti onImpl.java:2154)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImp l.java:792)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connect ion.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:41 1)
at com.mysql.jdbc.ConnectionImpl.getInstance(Connecti onImpl.java:381)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:305)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at prueba.PruebaMySQL(prueba.java:39)
at prueba.main(prueba.java:96)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.mysql.jdbc.StandardSocketFactory.connect(Stand ardSocketFactory.java:257)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:294)
... 16 more