Jump to content

Recommended Posts

Posted

In the 404 error message, it says the resource is not available, and it lists lani1234_CandC which is the name of my database. I am trying to connect to the mySQL database using my Java web app. Is there anything out of the ordinary that needs to be done to connect to the database I have set up on your server?

 

The database name is lani1234_CandC

username: lani1234_lani

password: dbpass

 

I am using:

driver = "com.mysql.jdbc.Driver"

url = "jdbc:mysql://localhost/lani1234_CandC"

 

I have this same .war file deploying fine on a different server.

I have placed a new .war file in my home directory (home/lani1234/CandC.war) if you wouldn't mind re-deploying it just in case I had a typo in the database name or something. I appreciate any input you might have otherwise.

Posted

Deployed. http://lani1234.heliohost.org/CandC

 

It looks like you might have already figured this out, but for the best response time just created a new thread each time you have a new version to deploy.

 

Here is a working snippet from a .jsp file that connects to a mysql database. Perhaps it will help you.

<sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost/username_jsptest"
    user="username_jsptest"  password="censored"/>

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

 

Also, it's usually a bad idea to post your passwords in a public forum.

Posted

I am still getting the same error message with this .war file.

I am connecting to the database through a java class. My web app uses jsp and java servlets. The jsp files access the servlets which do all the heavy lifting.

Although I am sure I have the code right for connecting through a java class, do you have a snippet of that?

Also, you use Tomcat, correct? What version? Could that be an issue if my project is optimized for Tomcat 7?

Thank you

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...