我可以通过编程方式访问 c3P0 连接池属性吗?
我担心我为 C3P0 连接池设置的属性没有被正确使用。
有没有办法可以访问应用程序运行时设置的值并将其打印出来:
Println("Minimum Connections"+connectionNumers.minimum);
谢谢
I am worried that the properties I have set for my C3P0 connection pool are not being used correctly.
Is there a way I can access the values that are set while the application is running and print them out:
Println("Minimum connections"+connectionNumers.minimum);
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 log4j 来输出调试信息,如下所示:
如果将上述内容放入名为
log4j.properties
的文件中,并将该文件放入类路径中,您应该从 c3p0 获得大量调试输出。示例输出:
log4j
You can use log4j to output debug information like so:
If you put the above in a file called
log4j.properties
and put that file in your classpath you should get tons of debug output from c3p0.Example output:
log4j
API 允许您以编程方式访问这些属性。
假设您有
ComboPooledDataSource
实例:您可以在运行时访问这些属性,例如:
加上一些其他有用的信息,例如:
来源:http://www.mchange.com/projects/c3p0/apidocs/com/mchange/v2/c3p0/ ComboPooledDataSource.html
The API does allow you to access these properties programmatically.
Given that you have your
ComboPooledDataSource
instance:You can access these properties at runtime, for example:
Plus some other helpful info, for example:
source: http://www.mchange.com/projects/c3p0/apidocs/com/mchange/v2/c3p0/ComboPooledDataSource.html
您想查看运行时信息或想要更改属性值吗?我不认为你可以在运行时更改属性值,因为这些配置值存储在内存中。
you want to see the runtime info or want change the property value? I don not you could change the property value in runtime because these config values are stored in ram.