JDBC Veritabanına Bağlanmıyor
-
Mysql jdbc connector eklentisini indirdim ve jar dosyasını projemde lib klasörüne ekleyip build path'den jar dosyamı tanımladım.
3 gün önce hem localhostuma hemde sitemin veritabanına bağlanabiliyorken bugün sitemin veritabanına bağlanamıyorum.
Programı çalıştırınca şu hatayı veriyor :
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: 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.Kodlarım bunlar :
static Connection con; static Statement st; static ResultSet rs; static String query = ""; public static void main(String[] args) { try{ Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection("jdbc:mysql://11.11.111.111:1111/veri_data", "veridataa", "verisifre"); st = con.createStatement(); query = "select * from oc_t_item_custom_attr_groups where s_name='Kedi'"; rs = st.executeQuery(query); while(rs.next()){ String sName = rs.getString("pk_i_id"); System.out.println(sName); } }catch(Exception e){ System.out.println(e); } }
-
Adamlar burda baya iyi anlatmış yani ben hiç denemediğim halde anladım denedınmı bunları http://stackoverflow.com/questions/2983248/com-mysql-jdbc-exceptions-jdbc4-communicationsexception-communications-link-fai
-
Bosluk bunu yazdı
Adamlar burda baya iyi anlatmış yani ben hiç denemediğim halde anladım denedınmı bunları http://stackoverflow.com/questions/2983248/com-mysql-jdbc-exceptions-jdbc4-communicationsexception-communications-link-fai
İp adresi ve kodları doğru. Şuanda siteme ve phpmyadmin'e bağlanabiliyorum ama hala program bağlanmıyor.
İp adresine ping gönderdiğim zaman Request Timeout diyor.
Onun dışında my.cnf ya da diğer dosyalara erişme, db restartlama gibi olaylara erişimim yok.