简体   繁体   English

如何通过Eclipse将postgres连接到heroku?

[英]How do you connect postgres to heroku through eclipse?

Hi I've been researching on how to use heroku with postgresql. 嗨,我一直在研究如何在postgresql中使用heroku。 Im supposed to code the application in eclipse and the language I'm using is java. 我应该用eclipse编写应用程序代码,而我使用的语言是java。 So far, I've downloades pgadmin 3 and connected it to heroku. 到目前为止,我已经下载了pgadmin 3并将其连接到heroku。 Im currently stuck, confused and wondering whether I'm in the right direction. 我目前陷入困境,感到困惑,想知道我的方向是否正确。 Is this correct: 这个对吗:

  1. Postgresql is hosted on heroku so you only need to establish a connection between postgres and java. Postgresql托管在heroku上,因此您只需要在postgres和Java之间建立连接。

  2. To connect java to heroku on eclipse, a JDBC of sorts should be used. 要将Java连接到Eclipse上的heroku,应使用各种JDBC。

  3. The database tables can be created in pgadmin and this should be pushed to heroku. 可以在pgadmin中创建数据库表,并且应该将其推送到heroku。

  4. Changes in the database should be done in the code. 数据库中的更改应在代码中完成。

I've gone through the postgresql guides on heroku and also found codes on the jdbc connection in java. 我浏览了heroku上的postgresql指南,并在java中的jdbc连接上找到了代码。 However, im confused as to uow to piece everything together. 但是,我不愿意将所有内容拼凑在一起。 Are there any guides that could be recommended as well? 有没有可以推荐的指南?

My ideas for your questions: 我对您的问题的想法:

1,2. 1,2 You can apply JDBC or any object relational mapping framework (Hibernate, Open JPA, Eclipse Link...). 您可以应用JDBC或任何对象关系映射框架(Hibernate,Open JPA,Eclipse Link ...)。

3,4 Yes, you're right... The main point is Heroku just provide you a Postgre service the way you deal with the service like you did in your localhost. 3,4是的,您是对的...要点是Heroku像在localhost中一样,以与您处理服务相同的方式向您提供Postgre服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM