我有一个应用程序托管在 Digital Ocean Droplet (VPS) 的 tomcat 7 服务器中。
应用程序运行顺利。但无论如何它都没有连接到数据库。我认为我在开发应用程序时用于本地主机的连接字符串根本没有帮助。不应该
我想要获取 digital ocean VPS连接字符串的具体示例。
如有任何不足的帮助,我们将不胜感激。 提前致谢!
添加了错误消息:
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
最佳答案
But it's not connecting to the database anyway.
是的。否则它怎么知道该表不存在?如果没有成功创建连接
,您就不会收到此错误。检查堆栈跟踪。
显然您已经准备好使用某些版本的 MySQL Connector for Java。
它的托管位置对使用哪个 JAR 文件具有零影响,而这又对您所获得的实际异常具有零明显影响。
关于java - Digital Ocean 中托管的应用程序的 MySQL JDBC 驱动程序连接字符串应该是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28271949/