java.sql.SQLException:URL 格式不正确
我正在使用 tomcat、Java 和 GWT。当尝试连接到数据库时,我的应用程序出现以下错误。相同的驱动程序信息可以在独立应用程序上完美运行。
java.sql.SQLException:URL 格式不正确: jdbc:timesten:client:dsn=XXXX_cachedb_devc;uid=XXXX;pwd=XXXXX 在 com.google.cloud.sql.jdbc.internal.Exceptions.driverUrlNotInCorrectFormat(Exceptions.java:103) 在 com.google.cloud.sql.jdbc.Driver.connect(Driver.java:47) 在 com.google.cloud.sql.jdbc.Driver.connect(Driver.java:24) 在 java.sql.DriverManager.getConnection(DriverManager.java:582) 在 java.sql.DriverManager.getConnection(DriverManager.java:207)
我可以知道如何解决这个问题吗?
I am using tomcat, Java with GWT. When try to connect to db my applcation spews the following error. the same driver information is perfectly running on stand alone application.
java.sql.SQLException: URL is not in the correct format:
jdbc:timesten:client:dsn=XXXX_cachedb_devc;uid=XXXX;pwd=XXXXX
at
com.google.cloud.sql.jdbc.internal.Exceptions.driverUrlNotInCorrectFormat(Exceptions.java:103)
at com.google.cloud.sql.jdbc.Driver.connect(Driver.java:47)
at com.google.cloud.sql.jdbc.Driver.connect(Driver.java:24)
at
java.sql.DriverManager.getConnection(DriverManager.java:582)
at
java.sql.DriverManager.getConnection(DriverManager.java:207)
May i know how can i over come this problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您要么正在尝试部署到 App Engine,要么以某种方式查看 appengine jar 在运行时类路径中的情况。
如果您不打算在 Google App Engine 上部署应用程序,只需从项目中删除应用程序引擎 SDK jar 即可。
另一方面,如果您想部署到应用程序引擎,请注意 GAE 尚不支持连接到外部数据库。您所能做的就是使用内存 SQL 数据库,例如 hsqldb。然后,您的连接 url 需要符合内存数据库的 hsqldb 连接 url 模式。
Looks like either you are trying to deploy to App Engine or somehow how appengine jars are in your runtime classpath.
If you are not planning to deploy your application at Google App Engine, simply remove the app engine SDK jars from your project.
On the other hand, if you want to deploy to app engine, do know that GAE does not yet support connecting to external databases. All you can do is to use in-memory SQL databases like hsqldb. Your connection url then needs to conform to the hsqldb connection url pattern for in-memory databases.