A Mocked JDBC Driver for Stored Procedures
Class.forName("memphis.Driver");
Connection connection = DriverManager.getConnection("jdbc:memphis:csv:classpath", "", "");
CallableStatement callableStatement = connection.prepareCall("{call sp_test(?)}");
callableStatement.execute();
String fistname = callableStatement.getString("fistname");
String lastname = callableStatement.getString(2);
Integer age = callableStatement.getInt("age");
assertThat(fistname, is("abdullah"));
assertThat(lastname, is("mohammad"));
assertThat(age, is(5));
Class.forName("memphis.Driver");
Connection connection = DriverManager.getConnection("jdbc:memphis:csv:file:https:///Users/mhewedy", "", "");
CallableStatement callableStatement = connection.prepareCall("{call sp_test(?)}");
callableStatement.execute();
nulls should be represented in CSV files as NULL
example:
fistname,lastname,age,nullInt,nullDate
abdullah,mohammad,5 ,NULL ,NULL
farida ,mohammad,3 ,NULL ,NULL
MockSupport.determineCsvFile