java - My project is connecting to mysql database on my local tomcat server 6 but not connecting on tomcat6 in hosting platform -


my project working fine on local machine. using private jvm hosting provided unlimitedgb.com, project working fine on eclipse tomcat server 6 when deploy project on tomcat server6 provided in ngasi panel, not connecting database. had verified connection string many times. had exported mysql file .sql file phpmyadmin panel provided in control panel verified username , password, database name , port number codded in "dblayer.java" (myproject/java resources :src/com.my.classes) several times.

i using "mysql-connector-java-5.1.26-bin.jar" java jason.jar additional libraries project. both files placed on "myproject/webcontent/web-inf/ib/" , added "myproject/java resources:src/libraries/ above location. using jre system library [jre7] in "mysql-connector-java-5.1.26-bin.jar" present default had added mysql connector not present in apache tomcat6 present @ hosting platform. json.jar working fine on server in hosting platform. had uploaded project war file , deployed in apache tomcat server 6 provided hosting. there no error showing project deploying propely project not getting connected database. please me fix this.

write jsp , try hit on this

<%@page import="java.sql.*"%> <%@ page language="java" contenttype="text/html; charset=iso-8859-1"     pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> </head> <body> start test<br> <% try{ %> <% class.forname("com.mysql.jdbc.driver");             con=drivermanager.getconnection("jdbc:mysql://localhost:3306/dbname","user","passowrd");             out.println("connected successfully");             preparedstatement preparedstatement=con.preparestatement("select * admin");             resultset rst=preparedstatement.executequery();             while(rst.next()){                 out.print("<br/>"+" "+rst.getstring(1)+"  "+rst.getstring(2)+"  "+rst.getstring(3));             }              preparedstatement=con.preparestatement("select count(*),admin_id,username admin username='ankit' , pwd=md5('ankit')");             rst=preparedstatement.executequery();             while(rst.next()){                 out.print("<br/>"+" "+rst.getstring(1)+"  "+rst.getstring(2)+"  "+rst.getstring(3));             } %> <%}catch(throwable t) {t.printstacktrace(response.getwriter());}%> </body> </html> 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -