Merge pull request #6285 from smowton/smowton/feature/spring-jdbc-object

Add models for org.springframework.jdbc.object
This commit is contained in:
Anders Schack-Mulligen
2021-07-15 09:06:56 +02:00
committed by GitHub
39 changed files with 915 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
lgtm,codescanning
* SQL-injection vulnerabilities relating to the `org.springframework.jdbc.object` are now recognised.

View File

@@ -24,7 +24,16 @@ private class SqlSinkCsv extends SinkModelCsv {
"org.springframework.jdbc.core;JdbcTemplate;false;queryForMap;;;Argument[0];sql",
"org.springframework.jdbc.core;JdbcTemplate;false;queryForObject;;;Argument[0];sql",
"org.springframework.jdbc.core;JdbcTemplate;false;queryForRowSet;;;Argument[0];sql",
"org.springframework.jdbc.core;JdbcTemplate;false;queryForStream;;;Argument[0];sql"
"org.springframework.jdbc.core;JdbcTemplate;false;queryForStream;;;Argument[0];sql",
"org.springframework.jdbc.object;BatchSqlUpdate;false;BatchSqlUpdate;;;Argument[1];sql",
"org.springframework.jdbc.object;MappingSqlQuery;false;BatchSqlUpdate;;;Argument[1];sql",
"org.springframework.jdbc.object;MappingSqlQueryWithParameters;false;BatchSqlUpdate;;;Argument[1];sql",
"org.springframework.jdbc.object;RdbmsOperation;true;setSql;;;Argument[0];sql",
"org.springframework.jdbc.object;SqlCall;false;SqlCall;;;Argument[1];sql",
"org.springframework.jdbc.object;SqlFunction;false;SqlFunction;;;Argument[1];sql",
"org.springframework.jdbc.object;SqlQuery;false;SqlQuery;;;Argument[1];sql",
"org.springframework.jdbc.object;SqlUpdate;false;SqlUpdate;;;Argument[1];sql",
"org.springframework.jdbc.object;UpdatableSqlQuery;false;UpdatableSqlQuery;;;Argument[1];sql"
]
}
}

View File

@@ -0,0 +1,44 @@
import java.sql.ResultSet;
import java.util.Map;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.object.BatchSqlUpdate;
import org.springframework.jdbc.object.MappingSqlQueryWithParameters;
import org.springframework.jdbc.object.SqlFunction;
import org.springframework.jdbc.object.SqlUpdate;
import org.springframework.jdbc.object.UpdatableSqlQuery;
public class SpringJdbc {
public static String source() { return null; }
private static class MyUpdatableSqlQuery extends UpdatableSqlQuery<String> {
public MyUpdatableSqlQuery() {
super(null, source()); // $ sqlInjection
}
protected String updateRow(ResultSet rs, int rowNum, Map<?,?> context) {
return null;
}
}
public static void test(JdbcTemplate template) {
new BatchSqlUpdate(null, source()); // $ sqlInjection
new SqlFunction(null, source()); // $ sqlInjection
new SqlUpdate(null, source()); // $ sqlInjection
(new BatchSqlUpdate()).setSql(source()); // $ sqlInjection
template.batchUpdate(source()); // $ sqlInjection
template.batchUpdate(source(), null, 0, null); // $ sqlInjection
template.execute(source()); // $ sqlInjection
template.update(source()); // $ sqlInjection
template.query(source(), (RowMapper)null); // $ sqlInjection
template.queryForList(source()); // $ sqlInjection
template.queryForMap(source()); // $ sqlInjection
template.queryForObject(source(), (Class)null); // $ sqlInjection
template.queryForRowSet(source()); // $ sqlInjection
template.queryForStream(source(), (RowMapper)null); // $ sqlInjection
}
}

View File

@@ -1 +1 @@
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../../stubs/mongodbClient
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../../stubs/mongodbClient:${testdir}/../../../../../stubs/springframework-5.3.8

View File

@@ -0,0 +1,41 @@
import java
import semmle.code.java.dataflow.TaintTracking
import semmle.code.java.security.QueryInjection
import TestUtilities.InlineExpectationsTest
private class QueryInjectionFlowConfig extends TaintTracking::Configuration {
QueryInjectionFlowConfig() { this = "SqlInjectionLib::QueryInjectionFlowConfig" }
override predicate isSource(DataFlow::Node src) {
src.asExpr() = any(MethodAccess ma | ma.getMethod().hasName("source"))
}
override predicate isSink(DataFlow::Node sink) { sink instanceof QueryInjectionSink }
override predicate isSanitizer(DataFlow::Node node) {
node.getType() instanceof PrimitiveType or
node.getType() instanceof BoxedType or
node.getType() instanceof NumberType
}
override predicate isAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2) {
any(AdditionalQueryInjectionTaintStep s).step(node1, node2)
}
}
class HasFlowTest extends InlineExpectationsTest {
HasFlowTest() { this = "HasFlowTest" }
override string getARelevantTag() { result = "sqlInjection" }
override predicate hasActualResult(Location location, string element, string tag, string value) {
tag = "sqlInjection" and
exists(DataFlow::Node src, DataFlow::Node sink, QueryInjectionFlowConfig conf |
conf.hasFlow(src, sink)
|
sink.getLocation() = location and
element = sink.toString() and
value = ""
)
}
}

View File

@@ -0,0 +1,15 @@
// Generated automatically from org.springframework.core.NestedRuntimeException for testing purposes
package org.springframework.core;
abstract public class NestedRuntimeException extends RuntimeException
{
protected NestedRuntimeException() {}
public NestedRuntimeException(String p0){}
public NestedRuntimeException(String p0, Throwable p1){}
public String getMessage(){ return null; }
public Throwable getMostSpecificCause(){ return null; }
public Throwable getRootCause(){ return null; }
public boolean contains(Class<? extends Object> p0){ return false; }
}

View File

@@ -0,0 +1,12 @@
// Generated automatically from org.springframework.dao.DataAccessException for testing purposes
package org.springframework.dao;
import org.springframework.core.NestedRuntimeException;
abstract public class DataAccessException extends NestedRuntimeException
{
protected DataAccessException() {}
public DataAccessException(String p0){}
public DataAccessException(String p0, Throwable p1){}
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from org.springframework.jdbc.core.BatchPreparedStatementSetter for testing purposes
package org.springframework.jdbc.core;
import java.sql.PreparedStatement;
public interface BatchPreparedStatementSetter
{
int getBatchSize();
void setValues(PreparedStatement p0, int p1);
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from org.springframework.jdbc.core.CallableStatementCallback for testing purposes
package org.springframework.jdbc.core;
import java.sql.CallableStatement;
public interface CallableStatementCallback<T>
{
T doInCallableStatement(CallableStatement p0);
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from org.springframework.jdbc.core.CallableStatementCreator for testing purposes
package org.springframework.jdbc.core;
import java.sql.CallableStatement;
import java.sql.Connection;
public interface CallableStatementCreator
{
CallableStatement createCallableStatement(Connection p0);
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from org.springframework.jdbc.core.ConnectionCallback for testing purposes
package org.springframework.jdbc.core;
import java.sql.Connection;
public interface ConnectionCallback<T>
{
T doInConnection(Connection p0);
}

View File

@@ -0,0 +1,89 @@
// Generated automatically from org.springframework.jdbc.core.JdbcOperations for testing purposes
package org.springframework.jdbc.core;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.jdbc.core.CallableStatementCallback;
import org.springframework.jdbc.core.CallableStatementCreator;
import org.springframework.jdbc.core.ConnectionCallback;
import org.springframework.jdbc.core.ParameterizedPreparedStatementSetter;
import org.springframework.jdbc.core.PreparedStatementCallback;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.core.PreparedStatementSetter;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.core.StatementCallback;
import org.springframework.jdbc.support.KeyHolder;
import org.springframework.jdbc.support.rowset.SqlRowSet;
public interface JdbcOperations
{
<T> List<T> query(PreparedStatementCreator p0, RowMapper<T> p1);
<T> List<T> query(String p0, Object[] p1, RowMapper<T> p2);
<T> List<T> query(String p0, Object[] p1, int[] p2, RowMapper<T> p3);
<T> List<T> query(String p0, PreparedStatementSetter p1, RowMapper<T> p2);
<T> List<T> query(String p0, RowMapper<T> p1);
<T> List<T> query(String p0, RowMapper<T> p1, Object... p2);
<T> List<T> queryForList(String p0, Class<T> p1);
<T> List<T> queryForList(String p0, Class<T> p1, Object... p2);
<T> List<T> queryForList(String p0, Object[] p1, Class<T> p2);
<T> List<T> queryForList(String p0, Object[] p1, int[] p2, Class<T> p3);
<T> Stream<T> queryForStream(PreparedStatementCreator p0, RowMapper<T> p1);
<T> Stream<T> queryForStream(String p0, PreparedStatementSetter p1, RowMapper<T> p2);
<T> Stream<T> queryForStream(String p0, RowMapper<T> p1);
<T> Stream<T> queryForStream(String p0, RowMapper<T> p1, Object... p2);
<T> T execute(CallableStatementCreator p0, CallableStatementCallback<T> p1);
<T> T execute(ConnectionCallback<T> p0);
<T> T execute(PreparedStatementCreator p0, PreparedStatementCallback<T> p1);
<T> T execute(StatementCallback<T> p0);
<T> T execute(String p0, CallableStatementCallback<T> p1);
<T> T execute(String p0, PreparedStatementCallback<T> p1);
<T> T query(PreparedStatementCreator p0, ResultSetExtractor<T> p1);
<T> T query(String p0, Object[] p1, ResultSetExtractor<T> p2);
<T> T query(String p0, Object[] p1, int[] p2, ResultSetExtractor<T> p3);
<T> T query(String p0, PreparedStatementSetter p1, ResultSetExtractor<T> p2);
<T> T query(String p0, ResultSetExtractor<T> p1);
<T> T query(String p0, ResultSetExtractor<T> p1, Object... p2);
<T> T queryForObject(String p0, Class<T> p1);
<T> T queryForObject(String p0, Class<T> p1, Object... p2);
<T> T queryForObject(String p0, Object[] p1, Class<T> p2);
<T> T queryForObject(String p0, Object[] p1, RowMapper<T> p2);
<T> T queryForObject(String p0, Object[] p1, int[] p2, Class<T> p3);
<T> T queryForObject(String p0, Object[] p1, int[] p2, RowMapper<T> p3);
<T> T queryForObject(String p0, RowMapper<T> p1);
<T> T queryForObject(String p0, RowMapper<T> p1, Object... p2);
<T> int[] batchUpdate(String p0, Collection<T> p1, int p2, ParameterizedPreparedStatementSetter<T> p3);
List<Map<String, Object>> queryForList(String p0);
List<Map<String, Object>> queryForList(String p0, Object... p1);
List<Map<String, Object>> queryForList(String p0, Object[] p1, int[] p2);
Map<String, Object> call(CallableStatementCreator p0, List<SqlParameter> p1);
Map<String, Object> queryForMap(String p0);
Map<String, Object> queryForMap(String p0, Object... p1);
Map<String, Object> queryForMap(String p0, Object[] p1, int[] p2);
SqlRowSet queryForRowSet(String p0);
SqlRowSet queryForRowSet(String p0, Object... p1);
SqlRowSet queryForRowSet(String p0, Object[] p1, int[] p2);
int update(PreparedStatementCreator p0);
int update(PreparedStatementCreator p0, KeyHolder p1);
int update(String p0);
int update(String p0, Object... p1);
int update(String p0, Object[] p1, int[] p2);
int update(String p0, PreparedStatementSetter p1);
int[] batchUpdate(String p0, BatchPreparedStatementSetter p1);
int[] batchUpdate(String p0, List<Object[]> p1);
int[] batchUpdate(String p0, List<Object[]> p1, int[] p2);
int[] batchUpdate(String... p0);
void execute(String p0);
void query(PreparedStatementCreator p0, RowCallbackHandler p1);
void query(String p0, Object[] p1, RowCallbackHandler p2);
void query(String p0, Object[] p1, int[] p2, RowCallbackHandler p3);
void query(String p0, PreparedStatementSetter p1, RowCallbackHandler p2);
void query(String p0, RowCallbackHandler p1);
void query(String p0, RowCallbackHandler p1, Object... p2);
}

View File

@@ -0,0 +1,133 @@
// Generated automatically from org.springframework.jdbc.core.JdbcTemplate for testing purposes
package org.springframework.jdbc.core;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
import javax.sql.DataSource;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.jdbc.core.CallableStatementCallback;
import org.springframework.jdbc.core.CallableStatementCreator;
import org.springframework.jdbc.core.ConnectionCallback;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.ParameterizedPreparedStatementSetter;
import org.springframework.jdbc.core.PreparedStatementCallback;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.core.PreparedStatementSetter;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.core.ResultSetSupportingSqlParameter;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.core.StatementCallback;
import org.springframework.jdbc.support.JdbcAccessor;
import org.springframework.jdbc.support.KeyHolder;
import org.springframework.jdbc.support.rowset.SqlRowSet;
public class JdbcTemplate extends JdbcAccessor implements JdbcOperations
{
protected <T> RowMapper<T> getSingleColumnRowMapper(Class<T> p0){ return null; }
protected Connection createConnectionProxy(Connection p0){ return null; }
protected DataAccessException translateException(String p0, String p1, SQLException p2){ return null; }
protected Map<String, Object> createResultsMap(){ return null; }
protected Map<String, Object> extractOutputParameters(CallableStatement p0, List<SqlParameter> p1){ return null; }
protected Map<String, Object> extractReturnedResults(CallableStatement p0, List<SqlParameter> p1, List<SqlParameter> p2, int p3){ return null; }
protected Map<String, Object> processResultSet(ResultSet p0, ResultSetSupportingSqlParameter p1){ return null; }
protected PreparedStatementSetter newArgPreparedStatementSetter(Object[] p0){ return null; }
protected PreparedStatementSetter newArgTypePreparedStatementSetter(Object[] p0, int[] p1){ return null; }
protected RowMapper<Map<String, Object>> getColumnMapRowMapper(){ return null; }
protected int update(PreparedStatementCreator p0, PreparedStatementSetter p1){ return 0; }
protected void applyStatementSettings(Statement p0){}
protected void handleWarnings(SQLWarning p0){}
protected void handleWarnings(Statement p0){}
public <T> List<T> query(PreparedStatementCreator p0, RowMapper<T> p1){ return null; }
public <T> List<T> query(String p0, Object[] p1, RowMapper<T> p2){ return null; }
public <T> List<T> query(String p0, Object[] p1, int[] p2, RowMapper<T> p3){ return null; }
public <T> List<T> query(String p0, PreparedStatementSetter p1, RowMapper<T> p2){ return null; }
public <T> List<T> query(String p0, RowMapper<T> p1){ return null; }
public <T> List<T> query(String p0, RowMapper<T> p1, Object... p2){ return null; }
public <T> List<T> queryForList(String p0, Class<T> p1){ return null; }
public <T> List<T> queryForList(String p0, Class<T> p1, Object... p2){ return null; }
public <T> List<T> queryForList(String p0, Object[] p1, Class<T> p2){ return null; }
public <T> List<T> queryForList(String p0, Object[] p1, int[] p2, Class<T> p3){ return null; }
public <T> Stream<T> queryForStream(PreparedStatementCreator p0, PreparedStatementSetter p1, RowMapper<T> p2){ return null; }
public <T> Stream<T> queryForStream(PreparedStatementCreator p0, RowMapper<T> p1){ return null; }
public <T> Stream<T> queryForStream(String p0, PreparedStatementSetter p1, RowMapper<T> p2){ return null; }
public <T> Stream<T> queryForStream(String p0, RowMapper<T> p1){ return null; }
public <T> Stream<T> queryForStream(String p0, RowMapper<T> p1, Object... p2){ return null; }
public <T> T execute(CallableStatementCreator p0, CallableStatementCallback<T> p1){ return null; }
public <T> T execute(ConnectionCallback<T> p0){ return null; }
public <T> T execute(PreparedStatementCreator p0, PreparedStatementCallback<T> p1){ return null; }
public <T> T execute(StatementCallback<T> p0){ return null; }
public <T> T execute(String p0, CallableStatementCallback<T> p1){ return null; }
public <T> T execute(String p0, PreparedStatementCallback<T> p1){ return null; }
public <T> T query(PreparedStatementCreator p0, PreparedStatementSetter p1, ResultSetExtractor<T> p2){ return null; }
public <T> T query(PreparedStatementCreator p0, ResultSetExtractor<T> p1){ return null; }
public <T> T query(String p0, Object[] p1, ResultSetExtractor<T> p2){ return null; }
public <T> T query(String p0, Object[] p1, int[] p2, ResultSetExtractor<T> p3){ return null; }
public <T> T query(String p0, PreparedStatementSetter p1, ResultSetExtractor<T> p2){ return null; }
public <T> T query(String p0, ResultSetExtractor<T> p1){ return null; }
public <T> T query(String p0, ResultSetExtractor<T> p1, Object... p2){ return null; }
public <T> T queryForObject(String p0, Class<T> p1){ return null; }
public <T> T queryForObject(String p0, Class<T> p1, Object... p2){ return null; }
public <T> T queryForObject(String p0, Object[] p1, Class<T> p2){ return null; }
public <T> T queryForObject(String p0, Object[] p1, RowMapper<T> p2){ return null; }
public <T> T queryForObject(String p0, Object[] p1, int[] p2, Class<T> p3){ return null; }
public <T> T queryForObject(String p0, Object[] p1, int[] p2, RowMapper<T> p3){ return null; }
public <T> T queryForObject(String p0, RowMapper<T> p1){ return null; }
public <T> T queryForObject(String p0, RowMapper<T> p1, Object... p2){ return null; }
public <T> int[] batchUpdate(String p0, Collection<T> p1, int p2, ParameterizedPreparedStatementSetter<T> p3){ return null; }
public JdbcTemplate(){}
public JdbcTemplate(DataSource p0){}
public JdbcTemplate(DataSource p0, boolean p1){}
public List<Map<String, Object>> queryForList(String p0){ return null; }
public List<Map<String, Object>> queryForList(String p0, Object... p1){ return null; }
public List<Map<String, Object>> queryForList(String p0, Object[] p1, int[] p2){ return null; }
public Map<String, Object> call(CallableStatementCreator p0, List<SqlParameter> p1){ return null; }
public Map<String, Object> queryForMap(String p0){ return null; }
public Map<String, Object> queryForMap(String p0, Object... p1){ return null; }
public Map<String, Object> queryForMap(String p0, Object[] p1, int[] p2){ return null; }
public SqlRowSet queryForRowSet(String p0){ return null; }
public SqlRowSet queryForRowSet(String p0, Object... p1){ return null; }
public SqlRowSet queryForRowSet(String p0, Object[] p1, int[] p2){ return null; }
public boolean isIgnoreWarnings(){ return false; }
public boolean isResultsMapCaseInsensitive(){ return false; }
public boolean isSkipResultsProcessing(){ return false; }
public boolean isSkipUndeclaredResults(){ return false; }
public int getFetchSize(){ return 0; }
public int getMaxRows(){ return 0; }
public int getQueryTimeout(){ return 0; }
public int update(PreparedStatementCreator p0){ return 0; }
public int update(PreparedStatementCreator p0, KeyHolder p1){ return 0; }
public int update(String p0){ return 0; }
public int update(String p0, Object... p1){ return 0; }
public int update(String p0, Object[] p1, int[] p2){ return 0; }
public int update(String p0, PreparedStatementSetter p1){ return 0; }
public int[] batchUpdate(String p0, BatchPreparedStatementSetter p1){ return null; }
public int[] batchUpdate(String p0, List<Object[]> p1){ return null; }
public int[] batchUpdate(String p0, List<Object[]> p1, int[] p2){ return null; }
public int[] batchUpdate(String... p0){ return null; }
public void execute(String p0){}
public void query(PreparedStatementCreator p0, RowCallbackHandler p1){}
public void query(String p0, Object[] p1, RowCallbackHandler p2){}
public void query(String p0, Object[] p1, int[] p2, RowCallbackHandler p3){}
public void query(String p0, PreparedStatementSetter p1, RowCallbackHandler p2){}
public void query(String p0, RowCallbackHandler p1){}
public void query(String p0, RowCallbackHandler p1, Object... p2){}
public void setFetchSize(int p0){}
public void setIgnoreWarnings(boolean p0){}
public void setMaxRows(int p0){}
public void setQueryTimeout(int p0){}
public void setResultsMapCaseInsensitive(boolean p0){}
public void setSkipResultsProcessing(boolean p0){}
public void setSkipUndeclaredResults(boolean p0){}
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from org.springframework.jdbc.core.ParameterizedPreparedStatementSetter for testing purposes
package org.springframework.jdbc.core;
import java.sql.PreparedStatement;
public interface ParameterizedPreparedStatementSetter<T>
{
void setValues(PreparedStatement p0, T p1);
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from org.springframework.jdbc.core.PreparedStatementCallback for testing purposes
package org.springframework.jdbc.core;
import java.sql.PreparedStatement;
public interface PreparedStatementCallback<T>
{
T doInPreparedStatement(PreparedStatement p0);
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from org.springframework.jdbc.core.PreparedStatementCreator for testing purposes
package org.springframework.jdbc.core;
import java.sql.Connection;
import java.sql.PreparedStatement;
public interface PreparedStatementCreator
{
PreparedStatement createPreparedStatement(Connection p0);
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from org.springframework.jdbc.core.PreparedStatementSetter for testing purposes
package org.springframework.jdbc.core;
import java.sql.PreparedStatement;
public interface PreparedStatementSetter
{
void setValues(PreparedStatement p0);
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from org.springframework.jdbc.core.ResultSetExtractor for testing purposes
package org.springframework.jdbc.core;
import java.sql.ResultSet;
public interface ResultSetExtractor<T>
{
T extractData(ResultSet p0);
}

View File

@@ -0,0 +1,24 @@
// Generated automatically from org.springframework.jdbc.core.ResultSetSupportingSqlParameter for testing purposes
package org.springframework.jdbc.core;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.SqlParameter;
public class ResultSetSupportingSqlParameter extends SqlParameter
{
protected ResultSetSupportingSqlParameter() {}
public ResultSetExtractor<? extends Object> getResultSetExtractor(){ return null; }
public ResultSetSupportingSqlParameter(String p0, int p1){}
public ResultSetSupportingSqlParameter(String p0, int p1, ResultSetExtractor<? extends Object> p2){}
public ResultSetSupportingSqlParameter(String p0, int p1, RowCallbackHandler p2){}
public ResultSetSupportingSqlParameter(String p0, int p1, RowMapper<? extends Object> p2){}
public ResultSetSupportingSqlParameter(String p0, int p1, String p2){}
public ResultSetSupportingSqlParameter(String p0, int p1, int p2){}
public RowCallbackHandler getRowCallbackHandler(){ return null; }
public RowMapper<? extends Object> getRowMapper(){ return null; }
public boolean isInputValueProvided(){ return false; }
public boolean isResultSetSupported(){ return false; }
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from org.springframework.jdbc.core.RowCallbackHandler for testing purposes
package org.springframework.jdbc.core;
import java.sql.ResultSet;
public interface RowCallbackHandler
{
void processRow(ResultSet p0);
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from org.springframework.jdbc.core.RowMapper for testing purposes
package org.springframework.jdbc.core;
import java.sql.ResultSet;
public interface RowMapper<T>
{
T mapRow(ResultSet p0, int p1);
}

View File

@@ -0,0 +1,24 @@
// Generated automatically from org.springframework.jdbc.core.SqlParameter for testing purposes
package org.springframework.jdbc.core;
import java.util.List;
public class SqlParameter
{
protected SqlParameter() {}
public Integer getScale(){ return null; }
public SqlParameter(SqlParameter p0){}
public SqlParameter(String p0, int p1){}
public SqlParameter(String p0, int p1, String p2){}
public SqlParameter(String p0, int p1, int p2){}
public SqlParameter(int p0){}
public SqlParameter(int p0, String p1){}
public SqlParameter(int p0, int p1){}
public String getName(){ return null; }
public String getTypeName(){ return null; }
public boolean isInputValueProvided(){ return false; }
public boolean isResultsParameter(){ return false; }
public int getSqlType(){ return 0; }
public static List<SqlParameter> sqlTypesToAnonymousParameterList(int... p0){ return null; }
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from org.springframework.jdbc.core.StatementCallback for testing purposes
package org.springframework.jdbc.core;
import java.sql.Statement;
public interface StatementCallback<T>
{
T doInStatement(Statement p0);
}

View File

@@ -0,0 +1,22 @@
// Generated automatically from org.springframework.jdbc.core.namedparam.ParsedSql for testing purposes
package org.springframework.jdbc.core.namedparam;
import java.util.List;
public class ParsedSql
{
protected ParsedSql() {}
List<String> getParameterNames(){ return null; }
ParsedSql(String p0){}
String getOriginalSql(){ return null; }
int getNamedParameterCount(){ return 0; }
int getTotalParameterCount(){ return 0; }
int getUnnamedParameterCount(){ return 0; }
int[] getParameterIndexes(int p0){ return null; }
public String toString(){ return null; }
void addNamedParameter(String p0, int p1, int p2){}
void setNamedParameterCount(int p0){}
void setTotalParameterCount(int p0){}
void setUnnamedParameterCount(int p0){}
}

View File

@@ -0,0 +1,24 @@
// Generated automatically from org.springframework.jdbc.object.BatchSqlUpdate for testing purposes
package org.springframework.jdbc.object;
import javax.sql.DataSource;
import org.springframework.jdbc.object.SqlUpdate;
public class BatchSqlUpdate extends SqlUpdate
{
protected boolean supportsLobParameters(){ return false; }
public BatchSqlUpdate(){}
public BatchSqlUpdate(DataSource p0, String p1){}
public BatchSqlUpdate(DataSource p0, String p1, int[] p2){}
public BatchSqlUpdate(DataSource p0, String p1, int[] p2, int p3){}
public int getExecutionCount(){ return 0; }
public int getQueueCount(){ return 0; }
public int update(Object... p0){ return 0; }
public int[] flush(){ return null; }
public int[] getRowsAffected(){ return null; }
public static int DEFAULT_BATCH_SIZE = 0;
public void reset(){}
public void setBatchSize(int p0){}
public void setTrackRowsAffected(boolean p0){}
}

View File

@@ -0,0 +1,16 @@
// Generated automatically from org.springframework.jdbc.object.MappingSqlQuery for testing purposes
package org.springframework.jdbc.object;
import java.sql.ResultSet;
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.jdbc.object.MappingSqlQueryWithParameters;
abstract public class MappingSqlQuery<T> extends MappingSqlQueryWithParameters<T>
{
protected abstract T mapRow(ResultSet p0, int p1);
protected final T mapRow(ResultSet p0, int p1, Object[] p2, Map<? extends Object, ? extends Object> p3){ return null; }
public MappingSqlQuery(){}
public MappingSqlQuery(DataSource p0, String p1){}
}

View File

@@ -0,0 +1,17 @@
// Generated automatically from org.springframework.jdbc.object.MappingSqlQueryWithParameters for testing purposes
package org.springframework.jdbc.object;
import java.sql.ResultSet;
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.object.SqlQuery;
abstract public class MappingSqlQueryWithParameters<T> extends SqlQuery<T>
{
protected RowMapper<T> newRowMapper(Object[] p0, Map<? extends Object, ? extends Object> p1){ return null; }
protected abstract T mapRow(ResultSet p0, int p1, Object[] p2, Map<? extends Object, ? extends Object> p3);
public MappingSqlQueryWithParameters(){}
public MappingSqlQueryWithParameters(DataSource p0, String p1){}
}

View File

@@ -0,0 +1,45 @@
// Generated automatically from org.springframework.jdbc.object.RdbmsOperation for testing purposes
package org.springframework.jdbc.object;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.SqlParameter;
abstract public class RdbmsOperation implements InitializingBean
{
protected List<SqlParameter> getDeclaredParameters(){ return null; }
protected String resolveSql(){ return null; }
protected abstract void compileInternal();
protected boolean allowsUnusedParameters(){ return false; }
protected boolean supportsLobParameters(){ return false; }
protected void checkCompiled(){}
protected void validateNamedParameters(Map<String, ? extends Object> p0){}
protected void validateParameters(Object[] p0){}
public JdbcTemplate getJdbcTemplate(){ return null; }
public RdbmsOperation(){}
public String getSql(){ return null; }
public String[] getGeneratedKeysColumnNames(){ return null; }
public boolean isCompiled(){ return false; }
public boolean isReturnGeneratedKeys(){ return false; }
public boolean isUpdatableResults(){ return false; }
public final void compile(){}
public int getResultSetType(){ return 0; }
public void afterPropertiesSet(){}
public void declareParameter(SqlParameter p0){}
public void setDataSource(DataSource p0){}
public void setFetchSize(int p0){}
public void setGeneratedKeysColumnNames(String... p0){}
public void setJdbcTemplate(JdbcTemplate p0){}
public void setMaxRows(int p0){}
public void setParameters(SqlParameter... p0){}
public void setQueryTimeout(int p0){}
public void setResultSetType(int p0){}
public void setReturnGeneratedKeys(boolean p0){}
public void setSql(String p0){}
public void setTypes(int[] p0){}
public void setUpdatableResults(boolean p0){}
}

View File

@@ -0,0 +1,23 @@
// Generated automatically from org.springframework.jdbc.object.SqlFunction for testing purposes
package org.springframework.jdbc.object;
import java.sql.ResultSet;
import javax.sql.DataSource;
import org.springframework.jdbc.object.MappingSqlQuery;
public class SqlFunction<T> extends MappingSqlQuery<T>
{
protected T mapRow(ResultSet p0, int p1){ return null; }
public Object runGeneric(){ return null; }
public Object runGeneric(Object[] p0){ return null; }
public Object runGeneric(int p0){ return null; }
public SqlFunction(){}
public SqlFunction(DataSource p0, String p1){}
public SqlFunction(DataSource p0, String p1, int[] p2){}
public SqlFunction(DataSource p0, String p1, int[] p2, Class<T> p3){}
public int run(){ return 0; }
public int run(Object... p0){ return 0; }
public int run(int p0){ return 0; }
public void setResultType(Class<T> p0){}
}

View File

@@ -0,0 +1,19 @@
// Generated automatically from org.springframework.jdbc.object.SqlOperation for testing purposes
package org.springframework.jdbc.object;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.core.PreparedStatementSetter;
import org.springframework.jdbc.core.namedparam.ParsedSql;
import org.springframework.jdbc.object.RdbmsOperation;
abstract public class SqlOperation extends RdbmsOperation
{
protected ParsedSql getParsedSql(){ return null; }
protected final PreparedStatementCreator newPreparedStatementCreator(Object[] p0){ return null; }
protected final PreparedStatementCreator newPreparedStatementCreator(String p0, Object[] p1){ return null; }
protected final PreparedStatementSetter newPreparedStatementSetter(Object[] p0){ return null; }
protected final void compileInternal(){}
protected void onCompileInternal(){}
public SqlOperation(){}
}

View File

@@ -0,0 +1,44 @@
// Generated automatically from org.springframework.jdbc.object.SqlQuery for testing purposes
package org.springframework.jdbc.object;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.object.SqlOperation;
abstract public class SqlQuery<T> extends SqlOperation
{
protected abstract RowMapper<T> newRowMapper(Object[] p0, Map<? extends Object, ? extends Object> p1);
public List<T> execute(){ return null; }
public List<T> execute(Map<? extends Object, ? extends Object> p0){ return null; }
public List<T> execute(Object... p0){ return null; }
public List<T> execute(Object[] p0, Map<? extends Object, ? extends Object> p1){ return null; }
public List<T> execute(String p0){ return null; }
public List<T> execute(String p0, Map<? extends Object, ? extends Object> p1){ return null; }
public List<T> execute(int p0){ return null; }
public List<T> execute(int p0, Map<? extends Object, ? extends Object> p1){ return null; }
public List<T> execute(int p0, int p1){ return null; }
public List<T> execute(int p0, int p1, Map<? extends Object, ? extends Object> p2){ return null; }
public List<T> execute(long p0){ return null; }
public List<T> execute(long p0, Map<? extends Object, ? extends Object> p1){ return null; }
public List<T> executeByNamedParam(Map<String, ? extends Object> p0){ return null; }
public List<T> executeByNamedParam(Map<String, ? extends Object> p0, Map<? extends Object, ? extends Object> p1){ return null; }
public SqlQuery(){}
public SqlQuery(DataSource p0, String p1){}
public T findObject(Object... p0){ return null; }
public T findObject(Object[] p0, Map<? extends Object, ? extends Object> p1){ return null; }
public T findObject(String p0){ return null; }
public T findObject(String p0, Map<? extends Object, ? extends Object> p1){ return null; }
public T findObject(int p0){ return null; }
public T findObject(int p0, Map<? extends Object, ? extends Object> p1){ return null; }
public T findObject(int p0, int p1){ return null; }
public T findObject(int p0, int p1, Map<? extends Object, ? extends Object> p2){ return null; }
public T findObject(long p0){ return null; }
public T findObject(long p0, Map<? extends Object, ? extends Object> p1){ return null; }
public T findObjectByNamedParam(Map<String, ? extends Object> p0){ return null; }
public T findObjectByNamedParam(Map<String, ? extends Object> p0, Map<? extends Object, ? extends Object> p1){ return null; }
public int getRowsExpected(){ return 0; }
public void setRowsExpected(int p0){}
}

View File

@@ -0,0 +1,30 @@
// Generated automatically from org.springframework.jdbc.object.SqlUpdate for testing purposes
package org.springframework.jdbc.object;
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.jdbc.object.SqlOperation;
import org.springframework.jdbc.support.KeyHolder;
public class SqlUpdate extends SqlOperation
{
protected void checkRowsAffected(int p0){}
public SqlUpdate(){}
public SqlUpdate(DataSource p0, String p1){}
public SqlUpdate(DataSource p0, String p1, int[] p2){}
public SqlUpdate(DataSource p0, String p1, int[] p2, int p3){}
public int update(){ return 0; }
public int update(Object... p0){ return 0; }
public int update(Object[] p0, KeyHolder p1){ return 0; }
public int update(String p0){ return 0; }
public int update(String p0, String p1){ return 0; }
public int update(int p0){ return 0; }
public int update(int p0, int p1){ return 0; }
public int update(long p0){ return 0; }
public int update(long p0, long p1){ return 0; }
public int updateByNamedParam(Map<String, ? extends Object> p0){ return 0; }
public int updateByNamedParam(Map<String, ? extends Object> p0, KeyHolder p1){ return 0; }
public void setMaxRowsAffected(int p0){}
public void setRequiredRowsAffected(int p0){}
}

View File

@@ -0,0 +1,17 @@
// Generated automatically from org.springframework.jdbc.object.UpdatableSqlQuery for testing purposes
package org.springframework.jdbc.object;
import java.sql.ResultSet;
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.object.SqlQuery;
abstract public class UpdatableSqlQuery<T> extends SqlQuery<T>
{
protected RowMapper<T> newRowMapper(Object[] p0, Map<? extends Object, ? extends Object> p1){ return null; }
protected abstract T updateRow(ResultSet p0, int p1, Map<? extends Object, ? extends Object> p2);
public UpdatableSqlQuery(){}
public UpdatableSqlQuery(DataSource p0, String p1){}
}

View File

@@ -0,0 +1,21 @@
// Generated automatically from org.springframework.jdbc.support.JdbcAccessor for testing purposes
package org.springframework.jdbc.support;
import javax.sql.DataSource;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.jdbc.support.SQLExceptionTranslator;
abstract public class JdbcAccessor implements InitializingBean
{
protected DataSource obtainDataSource(){ return null; }
public DataSource getDataSource(){ return null; }
public JdbcAccessor(){}
public SQLExceptionTranslator getExceptionTranslator(){ return null; }
public boolean isLazyInit(){ return false; }
public void afterPropertiesSet(){}
public void setDataSource(DataSource p0){}
public void setDatabaseProductName(String p0){}
public void setExceptionTranslator(SQLExceptionTranslator p0){}
public void setLazyInit(boolean p0){}
}

View File

@@ -0,0 +1,14 @@
// Generated automatically from org.springframework.jdbc.support.KeyHolder for testing purposes
package org.springframework.jdbc.support;
import java.util.List;
import java.util.Map;
public interface KeyHolder
{
<T> T getKeyAs(Class<T> p0);
List<Map<String, Object>> getKeyList();
Map<String, Object> getKeys();
Number getKey();
}

View File

@@ -0,0 +1,11 @@
// Generated automatically from org.springframework.jdbc.support.SQLExceptionTranslator for testing purposes
package org.springframework.jdbc.support;
import java.sql.SQLException;
import org.springframework.dao.DataAccessException;
public interface SQLExceptionTranslator
{
DataAccessException translate(String p0, String p1, SQLException p2);
}

View File

@@ -0,0 +1,70 @@
// Generated automatically from org.springframework.jdbc.support.rowset.SqlRowSet for testing purposes
package org.springframework.jdbc.support.rowset;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Map;
import org.springframework.jdbc.support.rowset.SqlRowSetMetaData;
public interface SqlRowSet extends Serializable
{
<T> T getObject(String p0, Class<T> p1);
<T> T getObject(int p0, Class<T> p1);
BigDecimal getBigDecimal(String p0);
BigDecimal getBigDecimal(int p0);
Date getDate(String p0);
Date getDate(String p0, Calendar p1);
Date getDate(int p0);
Date getDate(int p0, Calendar p1);
Object getObject(String p0);
Object getObject(String p0, Map<String, Class<? extends Object>> p1);
Object getObject(int p0);
Object getObject(int p0, Map<String, Class<? extends Object>> p1);
SqlRowSetMetaData getMetaData();
String getNString(String p0);
String getNString(int p0);
String getString(String p0);
String getString(int p0);
Time getTime(String p0);
Time getTime(String p0, Calendar p1);
Time getTime(int p0);
Time getTime(int p0, Calendar p1);
Timestamp getTimestamp(String p0);
Timestamp getTimestamp(String p0, Calendar p1);
Timestamp getTimestamp(int p0);
Timestamp getTimestamp(int p0, Calendar p1);
boolean absolute(int p0);
boolean first();
boolean getBoolean(String p0);
boolean getBoolean(int p0);
boolean isAfterLast();
boolean isBeforeFirst();
boolean isFirst();
boolean isLast();
boolean last();
boolean next();
boolean previous();
boolean relative(int p0);
boolean wasNull();
byte getByte(String p0);
byte getByte(int p0);
double getDouble(String p0);
double getDouble(int p0);
float getFloat(String p0);
float getFloat(int p0);
int findColumn(String p0);
int getInt(String p0);
int getInt(int p0);
int getRow();
long getLong(String p0);
long getLong(int p0);
short getShort(String p0);
short getShort(int p0);
void afterLast();
void beforeFirst();
}

View File

@@ -0,0 +1,24 @@
// Generated automatically from org.springframework.jdbc.support.rowset.SqlRowSetMetaData for testing purposes
package org.springframework.jdbc.support.rowset;
public interface SqlRowSetMetaData
{
String getCatalogName(int p0);
String getColumnClassName(int p0);
String getColumnLabel(int p0);
String getColumnName(int p0);
String getColumnTypeName(int p0);
String getSchemaName(int p0);
String getTableName(int p0);
String[] getColumnNames();
boolean isCaseSensitive(int p0);
boolean isCurrency(int p0);
boolean isSigned(int p0);
int getColumnCount();
int getColumnDisplaySize(int p0);
int getColumnType(int p0);
int getPrecision(int p0);
int getScale(int p0);
}