mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
decrement JdbcParameter memory used
This commit is contained in:
@@ -4,7 +4,7 @@ import java.sql.Types;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
public class JdbcParameterDate implements JdbcParameter {
|
||||
public final class JdbcParameterDate implements JdbcParameter {
|
||||
|
||||
private final Date value;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.math.BigDecimal;
|
||||
import java.sql.Types;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class JdbcParameterDecimal implements JdbcParameter {
|
||||
public final class JdbcParameterDecimal implements JdbcParameter {
|
||||
|
||||
private final BigDecimal value;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.alibaba.druid.proxy.jdbc;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
public class JdbcParameterImpl implements JdbcParameter {
|
||||
public final class JdbcParameterImpl implements JdbcParameter {
|
||||
|
||||
private final int sqlType;
|
||||
private final Object value;
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.alibaba.druid.proxy.jdbc;
|
||||
import java.sql.Types;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class JdbcParameterInt implements JdbcParameter {
|
||||
public final class JdbcParameterInt implements JdbcParameter {
|
||||
|
||||
private final int value;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.alibaba.druid.proxy.jdbc;
|
||||
import java.sql.Types;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class JdbcParameterLong implements JdbcParameter {
|
||||
public final class JdbcParameterLong implements JdbcParameter {
|
||||
|
||||
private final long value;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.alibaba.druid.proxy.jdbc;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
public class JdbcParameterNull implements JdbcParameter {
|
||||
public final class JdbcParameterNull implements JdbcParameter {
|
||||
|
||||
private final int sqlType;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.alibaba.druid.proxy.jdbc;
|
||||
import java.sql.Types;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class JdbcParameterString implements JdbcParameter {
|
||||
public final class JdbcParameterString implements JdbcParameter {
|
||||
|
||||
private final String value;
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.alibaba.druid.proxy.jdbc;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.sql.Types;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
public class JdbcParameterTimestamp implements JdbcParameter {
|
||||
public final class JdbcParameterTimestamp implements JdbcParameter {
|
||||
|
||||
private final Date value;
|
||||
private final Timestamp value;
|
||||
|
||||
public JdbcParameterTimestamp(Date value){
|
||||
public JdbcParameterTimestamp(Timestamp value){
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.alibaba.druid.proxy.jdbc.CallableStatementProxy;
|
||||
import com.alibaba.druid.proxy.jdbc.CallableStatementProxyImpl;
|
||||
import com.alibaba.druid.proxy.jdbc.ClobProxy;
|
||||
import com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl;
|
||||
import com.alibaba.druid.util.JdbcUtils;
|
||||
|
||||
public class FilterChainTest_Clob_2 extends TestCase {
|
||||
@@ -51,7 +52,7 @@ public class FilterChainTest_Clob_2 extends TestCase {
|
||||
}
|
||||
};
|
||||
|
||||
statement = new CallableStatementProxyImpl(null, mockStmt, "", 1);
|
||||
statement = new CallableStatementProxyImpl(new ConnectionProxyImpl(null, null, null, 0), mockStmt, "", 1);
|
||||
|
||||
}
|
||||
|
||||
@@ -69,16 +70,15 @@ public class FilterChainTest_Clob_2 extends TestCase {
|
||||
Assert.assertTrue(clob instanceof ClobProxy);
|
||||
Assert.assertEquals(1, invokeCount);
|
||||
}
|
||||
|
||||
|
||||
public void test_getClob_1() throws Exception {
|
||||
FilterChainImpl chain = new FilterChainImpl(dataSource);
|
||||
|
||||
|
||||
Clob clob = chain.callableStatement_getClob(statement, "1");
|
||||
|
||||
|
||||
Assert.assertTrue(clob instanceof ClobProxy);
|
||||
Assert.assertEquals(1, invokeCount);
|
||||
}
|
||||
|
||||
|
||||
public void test_getObject() throws Exception {
|
||||
FilterChainImpl chain = new FilterChainImpl(dataSource);
|
||||
@@ -88,30 +88,30 @@ public class FilterChainTest_Clob_2 extends TestCase {
|
||||
Assert.assertTrue(clob instanceof ClobProxy);
|
||||
Assert.assertEquals(1, invokeCount);
|
||||
}
|
||||
|
||||
|
||||
public void test_getObject_1() throws Exception {
|
||||
FilterChainImpl chain = new FilterChainImpl(dataSource);
|
||||
|
||||
|
||||
Clob clob = (Clob) chain.callableStatement_getObject(statement, "1");
|
||||
|
||||
|
||||
Assert.assertTrue(clob instanceof ClobProxy);
|
||||
Assert.assertEquals(1, invokeCount);
|
||||
}
|
||||
|
||||
|
||||
public void test_getObject_2() throws Exception {
|
||||
FilterChainImpl chain = new FilterChainImpl(dataSource);
|
||||
|
||||
Clob clob = (Clob) chain.callableStatement_getObject(statement, 1, Collections.<String, Class<?>>emptyMap());
|
||||
Clob clob = (Clob) chain.callableStatement_getObject(statement, 1, Collections.<String, Class<?>> emptyMap());
|
||||
|
||||
Assert.assertTrue(clob instanceof ClobProxy);
|
||||
Assert.assertEquals(1, invokeCount);
|
||||
}
|
||||
|
||||
|
||||
public void test_getObject_3() throws Exception {
|
||||
FilterChainImpl chain = new FilterChainImpl(dataSource);
|
||||
|
||||
Clob clob = (Clob) chain.callableStatement_getObject(statement, "1", Collections.<String, Class<?>>emptyMap());
|
||||
|
||||
|
||||
Clob clob = (Clob) chain.callableStatement_getObject(statement, "1", Collections.<String, Class<?>> emptyMap());
|
||||
|
||||
Assert.assertTrue(clob instanceof ClobProxy);
|
||||
Assert.assertEquals(1, invokeCount);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.alibaba.druid.mock.MockNClob;
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.alibaba.druid.proxy.jdbc.CallableStatementProxy;
|
||||
import com.alibaba.druid.proxy.jdbc.CallableStatementProxyImpl;
|
||||
import com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl;
|
||||
import com.alibaba.druid.proxy.jdbc.NClobProxy;
|
||||
import com.alibaba.druid.util.JdbcUtils;
|
||||
|
||||
@@ -51,7 +52,7 @@ public class FilterChainTest_NClob_2 extends TestCase {
|
||||
}
|
||||
};
|
||||
|
||||
statement = new CallableStatementProxyImpl(null, mockStmt, "", 1);
|
||||
statement = new CallableStatementProxyImpl(new ConnectionProxyImpl(null, null, null, 0), mockStmt, "", 1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user