choky10 Posted November 9, 2017 Posted November 9, 2017 Hello, im are 20 years old from mexico.I work in a goberment place, and every two moths i enter in a web page from gob.mx to downloand like 2000+ Bills. With my program running in java, i make the "Login More fast" I have my project in java in localhost Runnig, the page putme in Jonny Server y try to connect my project with the host using this code: boolean done = false; //load driver try { Class.forName(dbClass).newInstance(); System.out.println("driver loaded"); // THIS IS BEING RETURNED } catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) { System.err.println(ex); } try { conn = DriverManager.getConnection(dbDriver, user, pass); System.out.println("connected"); // THIS IS NOT BEING RETURNED done = true; } catch (SQLException ex) { System.out.println("SQLException: " + ex.getMessage()); } return done; } But if i test i just get like 1mn later..SQLException: Packet for query is too large (5526600 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable. I ask.. The server is slow.. or my code is wrong? My vars are: static private String user = "choky10"; static private String pass = ""; static private String dbClass = "com.mysql.jdbc.Driver"; static private String dbDriver = "jdbc:mysql://www.johnny.heliohost.org:2083/choky10_xxx"; static private Connection conn = null;
Krydos Posted November 9, 2017 Posted November 9, 2017 static private String dbDriver = "jdbc:mysql://www.johnny.heliohost.org:2083/choky10_xxx"; You're using the wrong port. Mysql is on port 3306. 2083 is cpanel. Try this static private String dbDriver = "jdbc:mysql://johnny.heliohost.org:3306/choky10_xxx";
choky10 Posted November 9, 2017 Author Posted November 9, 2017 Moved to Customer Service.Thanks i dont see... that now i get a new show error:driver loaded SQLException: Communications link The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. And i have a ask for my next payment i want to donate how much i need to donate? I just use the server in PHP for Private Work System, and MYSQL with java to run a basic app desktop to my work
Krydos Posted November 9, 2017 Posted November 9, 2017 Did you enable remote mysql connections? And i have a ask for my next payment i want to donateCool, thanks! how much i need to donate?We accept donations of $1.00 USD or more. Anything less than that and paypal takes too much of our donation. We recommend donating the amount that you feel our service is worth to you. I just use the server in PHP for Private Work System, and MYSQL with java to run a basic app desktop to my workAll of our servers can do what you need. When you make a donation you will have the opportunity to switch to the Tommy server. The main difference is Johnny is very slow and has a lot of downtime. Tommy is our fastest server and has pretty much perfect uptime.
choky10 Posted November 9, 2017 Author Posted November 9, 2017 Did you enable remote mysql connections? And i have a ask for my next payment i want to donateCool, thanks! how much i need to donate?We accept donations of $1.00 USD or more. Anything less than that and paypal takes too much of our donation. We recommend donating the amount that you feel our service is worth to you. I just use the server in PHP for Private Work System, and MYSQL with java to run a basic app desktop to my workAll of our servers can do what you need. When you make a donation you will have the opportunity to switch to the Tommy server. The main difference is Johnny is very slow and has a lot of downtime. Tommy is our fastest server and has pretty much perfect uptime. Yeah i put for all connections with "%" Now i just try, with a just one .java file for testing: package System; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; /** * * @author juan */ public class Conexion { static private String user = "choky10"; static private String pass = ""; static private String dbClass = "com.mysql.jdbc.Driver"; static private String dbDriver = "jdbc:mysql://johnny.heliohost.org:3306/choky10_corepi22"; static private Connection conn = null; public static void main(String[] args) { connect(); } public static Connection connect() { try { Class.forName(dbClass); System.out.println("driver loaded"); // THIS IS BEING RETURNED conn = DriverManager.getConnection(dbDriver, user, pass); System.out.println("connected"); // THIS IS NOT BEING RETURNED return conn; } catch (SQLException ex) { System.out.println("SQLException: " + ex.getMessage()); return null; } catch (ClassNotFoundException ex) { System.out.println("ERRRO"+ex); return null; } } } I see now with the port the file can connect to de server but i get that... i type that in google and is with the MYSQL config and i really dont know why this happen, my exp in java is very good but with mysql, i just know the basic how implements with java and doe, consults, tablets with keys, foreings etc UPDATE I add my public ip to remote MYSQL and work but why? I put the "%" SOLVED.I see the error, i put the is wrong i dont see very good..
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now