Jump to content

Help for mysql connection


mahesh55

Recommended Posts

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

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...