0

I have an application hosted in a tomcat 7 server in Digital Ocean droplet (VPS).

The application is running smoothly. But it's not connecting to the database anyway. I think the connection string I used for localhost while developing the application is not helping at all. It should not

I want to get an specific example of the connection string for digital ocean VPS.

Any short of help would be appreciated. Thanks in advance!

Added error messages:

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:965) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844) javax.servlet.http.HttpServlet.service(HttpServlet.java:620) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829) javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'advocatoree.Employee' doesn't exist

Tanvir Hossain Khan
  • 537
  • 1
  • 7
  • 22
  • possible duplicate of [What is the MySQL JDBC driver connection string?](http://stackoverflow.com/questions/1457716/what-is-the-mysql-jdbc-driver-connection-string) –  Feb 02 '15 at 07:15
  • I suggest you to post the stacktrace for your connection error. –  Feb 02 '15 at 07:16
  • I said this is not for localhost. It is for deploying in Digital Ocean VPS. So I don't find how it is possible duplicate of the mentioned question. – Tanvir Hossain Khan Feb 02 '15 at 07:31
  • Question edited. Posted the error messages I am getting. – Tanvir Hossain Khan Feb 02 '15 at 07:39
  • 2
    Your error shows that you're connecting fine, but that *Table 'advocatoree.Employee' doesn't exist*. I don't know how the message could be clearer. You're trying to use a database table that doesn't exist. – JB Nizet Feb 02 '15 at 07:58
  • I do have this table named 'employee' in the schema- advocatoree. – Tanvir Hossain Khan Feb 02 '15 at 08:30

2 Answers2

0

But it's not connecting to the database anyway.

Yes it is. How else could it know that the table doesn't exist? You can't get this error without creating a Connection successfully. Check the stack trace.

And clearly you're akready using some version of the MySQL Connector for Java.

And where it's hosted has zero bearing on which JAR file to use, which in turn has zero apparent bearing on the actual exception you are getting.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • As I told before, I have the exact database with all the tables which works perfectly and flawlessly when the application runs in the localhost. phpMyAdmin is showing up the database. If the application really gets connected to the db server, it should get the tables too. – Tanvir Hossain Khan Feb 02 '15 at 22:58
0

The issue was creating because all of my model class names were capitalized. But my database tables were not. I developed my application in a windows machine which is not case sensitive. But a Linux machine is case sensitive. I refactored the code and db tables and it worked.

Tanvir Hossain Khan
  • 537
  • 1
  • 7
  • 22