Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.
/ memphis Public archive

A Mocking JDBC Driver for Stored Procedures

Notifications You must be signed in to change notification settings

mhewedy/memphis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Memphis

A Mocked JDBC Driver for Stored Procedures

using classpath resources

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));

using filesystem resources

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 handling:

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

TODO

  1. MockSupport.determineCsvFile

About

A Mocking JDBC Driver for Stored Procedures

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages