-
Notifications
You must be signed in to change notification settings - Fork 0
db(client cursor), parser, etc
bleujin/ionframework
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
<h1>ionframework - System Framework(specially db and parser etc...)</h1>
<h2>Quick start</h2>
<p>View TestCode in sample/, test/</p>
DBManager dbm = new OracleDBManager("jdbc:oracle:thin:@hostaddress:1521:devTest", "bleu", "redf");
IDBController dc = new DBController(dbm);
dc.changeServant(new StdOutServant());
dc.initSelf();
Rows rows = dc.getRows("SELECT CONCAT('notice',no) id, no FROM zetyx_board_notice Group by no");
dc.destroySelf();
for more example, http://bleujin.tistory.com/153, but that is korean page
<p>sample test code. confirm sample/net/ion/framework/db/DBSampleAllTest.java</p>
<pre><code>
String query1 = "select * from copy_sample order by no1" ;
public void testDefaultLimit() throws Exception {
dc.setLimitedRows(20) ;
IUserCommand cmd = dc.createUserCommand(query1) ;
Rows rows = cmd.execQuery() ;
assertEquals(20, rows.getRowCount()) ;
rows.absolute(20) ;
assertEquals(20, rows.getInt("no2")) ;
}
</code></pre>
<p>if necessary, you can used that multi-procedure handled with exception(CompletableFuture Pattern)</p>
<pre><code>
AsyncDBController async = dc.async();
String returned = async.execute(ajob -> {
ajob.createUserProcedure("emp@insert(?,?)").addParam(20).addParam("hero").execUpdate() ;
ajob.createUserProcedure("emp@select").execQuery().debugPrint();
if (true) throw new IllegalStateException("expected") ;
return "not expected" ;
}).exceptionally(ex -> {
return "exception" ;
}).get() ;
assertEquals("exception", returned);
dc.createUserProcedure("emp@select").execQuery().debugPrint();
</code></pre>
About
db(client cursor), parser, etc
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published