apache-commons-dbcp

Using encoded password for the datasource used in spring applicationContext.xml

情到浓时终转凉″ 提交于 2019-12-02 17:35:38
I want to keep encoded password in my below mentioned springApplicationContext.xml Is there any way to achieve this? presently I have configured all properties using property-placeholder as shown below but the raw password is still open in my database.properties springApplicationContext.xml <beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <beans:property name="driverClassName"><beans:value>${db.driverClassName}</beans:value></beans:property> <beans:property name="url"><beans:value>${db.url}</beans:value></beans:property> <beans:property name=

Difference between BasicDatasource and PoolingDatasource

荒凉一梦 提交于 2019-12-02 17:30:13
What is the difference between org.apache.commons.dbcp BasicDatasource and PoolingDataSoure? Do both support pooling of connections? When to use each of them ? helios BasicDataSource is, as the javadoc says, a one-stop shopping for basic needs. It has all the necessary. It creates internally a PoolableDataSource and an ObjectPool. PoolingDataSource implements the DataSource interface using a provided ObjectPool. PoolingDatasource take cares of whatever has to do with connections (casting, checking validity, setting properties, etc) and ObjectPool take cares of holding and counting this

Stored Proc slower from application than Management Studio

时光总嘲笑我的痴心妄想 提交于 2019-12-02 12:09:31
We have a stored proc which runs pathetically when called from application (Spring - DBCP - jtds) infact timesout after 10 minutes, but runs in 30 seconds when executed from SQL Server Managament Stuido. Can someone provide leads into this issue? This normally indicates a parameter sniffing issue. See Slow in the Application, Fast in SSMS? Understanding Performance Mysteries for details. 来源: https://stackoverflow.com/questions/7504273/stored-proc-slower-from-application-than-management-studio

NoClassDefFoundError: org/apache/commons/pool/KeyedObjectPoolFactory BasicDataSource Spring

做~自己de王妃 提交于 2019-12-01 16:44:29
问题 I'm new to Spring, still learning. I'm using Spring Tool Suite version 3.5 with Java 6 on my Mac. I'm attempting to use BasicDataSource <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="${jdbc.driver}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> </bean> I have the following jar files on my class path:

NoClassDefFoundError: org/apache/commons/pool/KeyedObjectPoolFactory BasicDataSource Spring

坚强是说给别人听的谎言 提交于 2019-12-01 16:38:50
I'm new to Spring, still learning. I'm using Spring Tool Suite version 3.5 with Java 6 on my Mac. I'm attempting to use BasicDataSource <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="${jdbc.driver}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> </bean> I have the following jar files on my class path: commons-dbcp-1.4.jar , commons-pool2-2.2.jar , commons-collections4-4.0.jar . But I'm still seeing a

Connection Pooling with Apache DBCP

醉酒当歌 提交于 2019-11-29 22:22:41
I want to use Apache Commons DBCP to enable connection pooling in a Java Application (no container-provided DataSource in this). In many sites of the web -including Apache site - the usage of the library is based in this snippet: BasicDataSource ds = new BasicDataSource(); ds.setDriverClassName("oracle.jdbc.driver.OracleDriver"); ds.setUsername("scott"); ds.setPassword("tiger"); ds.setUrl(connectURI); Then you get your DB connections through the getConnection() method. But on other sites -and Apache Site also - the Datasource instance is made through this: ConnectionFactory connectionFactory =

Using PreparedStatement pooling in dbcp

时光总嘲笑我的痴心妄想 提交于 2019-11-29 04:38:12
Can someone explain how exactly prepared connection pooling using dbcp can be used? (with some example code if possible). I've figured out how to turn it on - passing a KeyedObjectPoolFactory to the PoolableConnectionFactory. But how should the specific prepared statements be defined after that? Right now I'm only using a PoolingDataSource to get connections from the pool. How do I use the prepared statements from the pool? Well talking about getting connection from the pool vs getting "not-pooled" connection, do you have any change in your code :)? I bet you do not. Same way with prepared

DBCP returns closed connections

偶尔善良 提交于 2019-11-29 00:27:18
We are seeing situations where our database connection from org.apache.commons.dbcp.BasicDataSource is dying with socket write errors: com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset by peer: socket write error All subsequent attempts to write to the connection fail, of course: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. After updating the code to catch such exceptions and request a new connection when it occurs, it failed again. Am I correct in suspecting that calling DataSource#getConnection() is not actually giving a new connection each time

Apache Commons DBCP connection object problem, Thread: ClassCastException in org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper

好久不见. 提交于 2019-11-28 20:18:48
I am using Apache Commons DBCP ( commons-dbcp.jar ) Connection pool. Once I obtained a connection from the pool it is wrapped in the class org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper . My requirement is to pass an array of Strings to pl/sql stored procedure in Oracle. Here is what I am doing in the following code snippet: Connection dbConn = ConnectionManager.ds.getConnection(); //The above statement returns me an connection wrapped in the class //org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper. org.apache.commons.dbcp.DelegatingConnection del =

Method org.postgresql.jdbc4.Jdbc4Connection.isValid(int) is not yet implemented

半腔热情 提交于 2019-11-28 09:38:37
I am trying to configure dbcp2 with postgres 9.1 When I run my app, it throws exception: Exception in thread "main" org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Method org.postgresql.jdbc4.Jdbc4Connection.isValid(int) is not yet implemented.) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:575) at org.springframework.jdbc.core.JdbcTemplate.query