如何在Java web应用程序中访问Heroku ClearDB?
我已经完成了ClearDB的插件Heroku,我想在Java web应用程序中使用Hibernate访问该数据库如何在Java web应用程序中访问Heroku ClearDB?,java,database,hibernate,Java,Database,Hibernate,我已经完成了ClearDB的插件Heroku,我想在Java web应用程序中使用Hibernate访问该数据库 我还添加了到MySQL工作台的连接 您必须将以下属性添加到您的hibernate.cfg.xml文件中 <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> <property name="hibernate.connection.driver_c
我还添加了到MySQL工作台的连接 您必须将以下属性添加到您的hibernate.cfg.xml文件中
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://us-cdbr-iron-east-03.cleardb.net:3306/heroku_123456789?zeroDateTimeBehavior=convertToNull</property>
<property name="hibernate.connection.username">my_username</property>
<property name="hibernate.connection.password">my_passsword</property>
org.hibernate.dialogue.mysqldialogue
com.mysql.jdbc.Driver
jdbc:mysql://us-cdbr-iron-east-03.cleardb.net:3306/heroku_123456789?zeroDateTimeBehavior=convertToNull
我的用户名
我的剑
请注意,hibernate.connection.url的属性值仅为示例。但是它有URL格式。您已将其替换为您自己的URL
hibernate.connection.username和hibernate.connection.password的属性值也应该被替换。是的。我试过了,它显示错误,说“无法打开连接”。你是通过代理访问它吗?不是。我只是使用heroku凭据在本地主机上运行它。