
我已经设置了以下JDBC url来连接到我的Postgresql数据库:
jdbc:postgresql://localhost:5435/MyDB?application-name=MyApp
我也试过这个url,没有更多的成功.
jdbc:postgresql://localhost:5435/MyDB?application_name=MyApp
什么是正确的参数名称?
这是我的JDBC驱动程序版本:9.1-901.jdbc4
查看 PostgreSQL JDBC 9.1 documentation,connection parameters,JDBC URL中正确的属性名称为Applicationname:
Applicationname = StringSpecifIEs the name of the application that is using the connection. This allows a database administrator to see what applications are connected to the server and what resources they are using through vIEws like
pg_stat_activity
所以尝试:
jdbc:postgresql://localhost:5435/MyDB?Applicationname=MyApp总结
以上是内存溢出为你收集整理的如何在Postgresql JDBC url中设置应用程序名称?全部内容,希望文章能够帮你解决如何在Postgresql JDBC url中设置应用程序名称?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)