Jump to content

Recommended Posts

Posted

hello sir

   I have deploy my web app. but i having problem for connection with mysql database

my code is below

 

public static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
static final String DB_URL = "jdbc:mysql://localhost:3306/myDB";
static final String USER = "myusername";
static final String PASS = "mypassword";

 

please assist me for removing error.

 

also i cannot able to connect to remote mysql. so please provide me syntax for conection.

(i have used wildcard for access all ip) .

 

Is there any way to change particular file without uploading again war file. because my war file is big. it takes too time.

 

 

 

thanks

Posted

Connecting to MySQL Using PHP

The question was how to connect to mysql with java not php.

 

Here's the code I use to connect to mysql from a .jsp:

<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>

<sql:setDataSource var="mysql_test" driver="com.mysql.jdbc.Driver"

     url="jdbc:mysql://localhost/krydos_test?serverTimezone=UTC"
     user="krydos_test"  password="<removed>"/>

<sql:query dataSource="${mysql_test}" var="result">
SELECT * from java;
</sql:query>

also i cannot able to connect to remote mysql. so please provide me syntax for conection.

(i have used wildcard for access all ip) .

For remote mysql use the host johnny.heliohost.org port 3306.

 

Is there any way to change particular file without uploading again war file. because my war file is big. it takes too time.

No, the only way to change a deployed .war is to upload the new version and request it to be deployed again. As long as you use the same filename it will be deployed in minutes rather than taking up to 12 hours to start working though.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...