{"action":"created","issue":{"url":"https://api.github.com/repos/jcabi/jcabi-jdbc/issues/53","repository_url":"https://api.github.com/repos/jcabi/jcabi-jdbc","labels_url":"https://api.github.com/repos/jcabi/jcabi-jdbc/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/jcabi/jcabi-jdbc/issues/53/comments","events_url":"https://api.github.com/repos/jcabi/jcabi-jdbc/issues/53/events","html_url":"https://github.com/jcabi/jcabi-jdbc/pull/53","id":171048661,"number":53,"title":"Added classes Connect.Call and StoredProcedureOutcome","user":{"login":"amihaiemil","id":6305156,"avatar_url":"https://avatars.githubusercontent.com/u/6305156?v=3","gravatar_id":"","url":"https://api.github.com/users/amihaiemil","html_url":"https://github.com/amihaiemil","followers_url":"https://api.github.com/users/amihaiemil/followers","following_url":"https://api.github.com/users/amihaiemil/following{/other_user}","gists_url":"https://api.github.com/users/amihaiemil/gists{/gist_id}","starred_url":"https://api.github.com/users/amihaiemil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amihaiemil/subscriptions","organizations_url":"https://api.github.com/users/amihaiemil/orgs","repos_url":"https://api.github.com/users/amihaiemil/repos","events_url":"https://api.github.com/users/amihaiemil/events{/privacy}","received_events_url":"https://api.github.com/users/amihaiemil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jcabi/jcabi-jdbc/labels/15%20mins","name":"15 mins","color":"eb6421"},{"url":"https://api.github.com/repos/jcabi/jcabi-jdbc/labels/@mkordas","name":"@mkordas","color":"009801"},{"url":"https://api.github.com/repos/jcabi/jcabi-jdbc/labels/CR","name":"CR","color":"bfd4f3"}],"state":"open","locked":false,"assignee":{"login":"mkordas","id":5467276,"avatar_url":"https://avatars.githubusercontent.com/u/5467276?v=3","gravatar_id":"","url":"https://api.github.com/users/mkordas","html_url":"https://github.com/mkordas","followers_url":"https://api.github.com/users/mkordas/followers","following_url":"https://api.github.com/users/mkordas/following{/other_user}","gists_url":"https://api.github.com/users/mkordas/gists{/gist_id}","starred_url":"https://api.github.com/users/mkordas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkordas/subscriptions","organizations_url":"https://api.github.com/users/mkordas/orgs","repos_url":"https://api.github.com/users/mkordas/repos","events_url":"https://api.github.com/users/mkordas/events{/privacy}","received_events_url":"https://api.github.com/users/mkordas/received_events","type":"User","site_admin":false},"assignees":[{"login":"mkordas","id":5467276,"avatar_url":"https://avatars.githubusercontent.com/u/5467276?v=3","gravatar_id":"","url":"https://api.github.com/users/mkordas","html_url":"https://github.com/mkordas","followers_url":"https://api.github.com/users/mkordas/followers","following_url":"https://api.github.com/users/mkordas/following{/other_user}","gists_url":"https://api.github.com/users/mkordas/gists{/gist_id}","starred_url":"https://api.github.com/users/mkordas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkordas/subscriptions","organizations_url":"https://api.github.com/users/mkordas/orgs","repos_url":"https://api.github.com/users/mkordas/repos","events_url":"https://api.github.com/users/mkordas/events{/privacy}","received_events_url":"https://api.github.com/users/mkordas/received_events","type":"User","site_admin":false}],"milestone":null,"comments":39,"created_at":"2016-08-14T08:36:21Z","updated_at":"2016-09-02T21:57:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jcabi/jcabi-jdbc/pulls/53","html_url":"https://github.com/jcabi/jcabi-jdbc/pull/53","diff_url":"https://github.com/jcabi/jcabi-jdbc/pull/53.diff","patch_url":"https://github.com/jcabi/jcabi-jdbc/pull/53.patch"},"body":"PR for #51 .\r\nAdded Outcome and Connect that provide calling stored procedure functionality. \r\n**E.g 1.**\r\nSay you have a stored procedure which takes 1 INPUT and 1 OUTPUT, this is how you would use the API to call it: \r\n```\r\nfinal Object[] result = new JdbcSession(dsrc)\r\n            .sql(\"{call getUserById(?, ?)}\")\r\n            .set(1)\r\n            .prepare(\r\n                new Preparation() {\r\n                    @Override\r\n                    public void prepare(\r\n                        final PreparedStatement stmt\r\n                    ) throws SQLException {\r\n                        ((CallableStatement) stmt)\r\n                            .registerOutParameter(2, Types.VARCHAR);\r\n                    }\r\n                }\r\n             )\r\n            .call(new StoredProcedureOutcome<Object[]>(2));\r\n```\r\n\r\nUnlike ``execute()`` and others, ``JdbcSession.call(Outcome)`` opens a ``CallableStatement``, instead of a ``PreparedStatement``. Output parameters need to be registered by providing a ``Preparation`` .\r\n\r\n**E.g. 2:**\r\n\r\nIf you have IN and OUT Params together, let's say in the following order:\r\n``IN, OUT, IN, OUT``, then you have to use the ``Outcome`` as follows:\r\nnew StoredProcedureOutcome<Object[]>(2, 4)\r\n"},"comment":{"url":"https://api.github.com/repos/jcabi/jcabi-jdbc/issues/comments/244496793","html_url":"https://github.com/jcabi/jcabi-jdbc/pull/53#issuecomment-244496793","issue_url":"https://api.github.com/repos/jcabi/jcabi-jdbc/issues/53","id":244496793,"user":{"login":"mkordas","id":5467276,"avatar_url":"https://avatars.githubusercontent.com/u/5467276?v=3","gravatar_id":"","url":"https://api.github.com/users/mkordas","html_url":"https://github.com/mkordas","followers_url":"https://api.github.com/users/mkordas/followers","following_url":"https://api.github.com/users/mkordas/following{/other_user}","gists_url":"https://api.github.com/users/mkordas/gists{/gist_id}","starred_url":"https://api.github.com/users/mkordas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkordas/subscriptions","organizations_url":"https://api.github.com/users/mkordas/orgs","repos_url":"https://api.github.com/users/mkordas/repos","events_url":"https://api.github.com/users/mkordas/events{/privacy}","received_events_url":"https://api.github.com/users/mkordas/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T21:57:16Z","updated_at":"2016-09-02T21:57:16Z","body":"@yegor256 ping"}}
{"actor":{"display_login":"mkordas"}}