{"action":"created","comment":{"url":"https://api.github.com/repos/Talend/components/pulls/comments/80193314","id":80193314,"diff_hunk":"@@ -0,0 +1,210 @@\n+// ============================================================================\n+//\n+// Copyright (C) 2006-2015 Talend Inc. - www.talend.com\n+//\n+// This source code is available under agreement available at\n+// %InstallDIR%\\features\\org.talend.rcp.branding.%PRODUCTNAME%\\%PRODUCTNAME%license.txt\n+//\n+// You should have received a copy of the agreement\n+// along with this program; if not, write to Talend SA\n+// 9 rue Pages 92150 Suresnes, France\n+//\n+// ============================================================================\n+package org.talend.components.jdbc.runtime.reader;\n+\n+import java.io.IOException;\n+import java.sql.Connection;\n+import java.sql.PreparedStatement;\n+import java.sql.ResultSet;\n+import java.sql.SQLException;\n+import java.sql.Statement;\n+import java.util.HashMap;\n+import java.util.Map;\n+import java.util.NoSuchElementException;\n+\n+import org.apache.avro.Schema;\n+import org.apache.avro.generic.GenericData;\n+import org.apache.avro.generic.IndexedRecord;\n+import org.talend.components.api.component.runtime.AbstractBoundedReader;\n+import org.talend.components.api.component.runtime.Result;\n+import org.talend.components.api.container.RuntimeContainer;\n+import org.talend.components.api.exception.ComponentException;\n+import org.talend.components.api.exception.DataRejectException;\n+import org.talend.components.jdbc.runtime.JDBCRowSource;\n+import org.talend.components.jdbc.runtime.JDBCTemplate;\n+import org.talend.components.jdbc.tjdbcrow.TJDBCRowProperties;\n+\n+public class JDBCRowReader extends AbstractBoundedReader<IndexedRecord> {\n+\n+    protected TJDBCRowProperties properties;\n+\n+    protected RuntimeContainer container;\n+\n+    protected Connection conn;\n+\n+    protected ResultSet resultSet;\n+\n+    private transient Schema querySchema;\n+\n+    private JDBCRowSource source;\n+\n+    private PreparedStatement prepared_statement;\n+\n+    private Statement statement;\n+\n+    private Result result;\n+\n+    private boolean useExistedConnection;\n+\n+    private boolean dieOnError;\n+\n+    public JDBCRowReader(RuntimeContainer container, JDBCRowSource source, TJDBCRowProperties props) {\n+        super(source);\n+        this.container = container;\n+        this.properties = props;\n+        this.source = (JDBCRowSource) getCurrentSource();\n+\n+        this.dieOnError = props.dieOnError.getValue();\n+\n+    }\n+\n+    @SuppressWarnings(\"unused\")\n+    private Schema getSchema() {\n+        if (querySchema == null) {\n+            querySchema = properties.main.schema.getValue();\n+        }\n+        return querySchema;\n+    }\n+\n+    @Override\n+    public boolean start() throws IOException {\n+        // TODO need to adjust the key\n+        if (container != null) {\n+            container.setComponentData(container.getCurrentComponentId(), \"QUERY\", properties.sql.getValue());","path":"components-jdbc/src/main/java/org/talend/components/jdbc/runtime/reader/JDBCRowReader.java","position":83,"original_position":83,"commit_id":"e716b06b11cd690811faec5343955e4c6a8674d1","original_commit_id":"e716b06b11cd690811faec5343955e4c6a8674d1","user":{"login":"gonchar-ivan","id":7621737,"avatar_url":"https://avatars.githubusercontent.com/u/7621737?v=3","gravatar_id":"","url":"https://api.github.com/users/gonchar-ivan","html_url":"https://github.com/gonchar-ivan","followers_url":"https://api.github.com/users/gonchar-ivan/followers","following_url":"https://api.github.com/users/gonchar-ivan/following{/other_user}","gists_url":"https://api.github.com/users/gonchar-ivan/gists{/gist_id}","starred_url":"https://api.github.com/users/gonchar-ivan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonchar-ivan/subscriptions","organizations_url":"https://api.github.com/users/gonchar-ivan/orgs","repos_url":"https://api.github.com/users/gonchar-ivan/repos","events_url":"https://api.github.com/users/gonchar-ivan/events{/privacy}","received_events_url":"https://api.github.com/users/gonchar-ivan/received_events","type":"User","site_admin":false},"body":"Flow variable.\r\nJust to not forget. We will need to adjust it later:\r\n1. Add QUERY flow variable in Definition.getReturnProperties()\r\n2. Update this according updated flow variable mechanism\r\n(currently it is not supported)","created_at":"2016-09-23T07:24:46Z","updated_at":"2016-09-23T07:41:22Z","html_url":"https://github.com/Talend/components/pull/251#discussion_r80193314","pull_request_url":"https://api.github.com/repos/Talend/components/pulls/251","_links":{"self":{"href":"https://api.github.com/repos/Talend/components/pulls/comments/80193314"},"html":{"href":"https://github.com/Talend/components/pull/251#discussion_r80193314"},"pull_request":{"href":"https://api.github.com/repos/Talend/components/pulls/251"}}},"pull_request":{"url":"https://api.github.com/repos/Talend/components/pulls/251","id":86455936,"html_url":"https://github.com/Talend/components/pull/251","diff_url":"https://github.com/Talend/components/pull/251.diff","patch_url":"https://github.com/Talend/components/pull/251.patch","issue_url":"https://api.github.com/repos/Talend/components/issues/251","number":251,"state":"open","locked":false,"title":"Feature/6.3/tdi 37456 rebase","user":{"login":"wwang-talend","id":7802267,"avatar_url":"https://avatars.githubusercontent.com/u/7802267?v=3","gravatar_id":"","url":"https://api.github.com/users/wwang-talend","html_url":"https://github.com/wwang-talend","followers_url":"https://api.github.com/users/wwang-talend/followers","following_url":"https://api.github.com/users/wwang-talend/following{/other_user}","gists_url":"https://api.github.com/users/wwang-talend/gists{/gist_id}","starred_url":"https://api.github.com/users/wwang-talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwang-talend/subscriptions","organizations_url":"https://api.github.com/users/wwang-talend/orgs","repos_url":"https://api.github.com/users/wwang-talend/repos","events_url":"https://api.github.com/users/wwang-talend/events{/privacy}","received_events_url":"https://api.github.com/users/wwang-talend/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-23T05:28:55Z","updated_at":"2016-09-23T07:41:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9068a206673b9d6413a4c6e6d7beb0d9b79e7a31","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Talend/components/pulls/251/commits","review_comments_url":"https://api.github.com/repos/Talend/components/pulls/251/comments","review_comment_url":"https://api.github.com/repos/Talend/components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Talend/components/issues/251/comments","statuses_url":"https://api.github.com/repos/Talend/components/statuses/e716b06b11cd690811faec5343955e4c6a8674d1","head":{"label":"Talend:feature/6.3/TDI-37456-rebase","ref":"feature/6.3/TDI-37456-rebase","sha":"e716b06b11cd690811faec5343955e4c6a8674d1","user":{"login":"Talend","id":459687,"avatar_url":"https://avatars.githubusercontent.com/u/459687?v=3","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"repo":{"id":39855061,"name":"components","full_name":"Talend/components","owner":{"login":"Talend","id":459687,"avatar_url":"https://avatars.githubusercontent.com/u/459687?v=3","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Talend/components","description":"Talend component infrastructure and public components","fork":false,"url":"https://api.github.com/repos/Talend/components","forks_url":"https://api.github.com/repos/Talend/components/forks","keys_url":"https://api.github.com/repos/Talend/components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Talend/components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Talend/components/teams","hooks_url":"https://api.github.com/repos/Talend/components/hooks","issue_events_url":"https://api.github.com/repos/Talend/components/issues/events{/number}","events_url":"https://api.github.com/repos/Talend/components/events","assignees_url":"https://api.github.com/repos/Talend/components/assignees{/user}","branches_url":"https://api.github.com/repos/Talend/components/branches{/branch}","tags_url":"https://api.github.com/repos/Talend/components/tags","blobs_url":"https://api.github.com/repos/Talend/components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Talend/components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Talend/components/git/refs{/sha}","trees_url":"https://api.github.com/repos/Talend/components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Talend/components/statuses/{sha}","languages_url":"https://api.github.com/repos/Talend/components/languages","stargazers_url":"https://api.github.com/repos/Talend/components/stargazers","contributors_url":"https://api.github.com/repos/Talend/components/contributors","subscribers_url":"https://api.github.com/repos/Talend/components/subscribers","subscription_url":"https://api.github.com/repos/Talend/components/subscription","commits_url":"https://api.github.com/repos/Talend/components/commits{/sha}","git_commits_url":"https://api.github.com/repos/Talend/components/git/commits{/sha}","comments_url":"https://api.github.com/repos/Talend/components/comments{/number}","issue_comment_url":"https://api.github.com/repos/Talend/components/issues/comments{/number}","contents_url":"https://api.github.com/repos/Talend/components/contents/{+path}","compare_url":"https://api.github.com/repos/Talend/components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Talend/components/merges","archive_url":"https://api.github.com/repos/Talend/components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Talend/components/downloads","issues_url":"https://api.github.com/repos/Talend/components/issues{/number}","pulls_url":"https://api.github.com/repos/Talend/components/pulls{/number}","milestones_url":"https://api.github.com/repos/Talend/components/milestones{/number}","notifications_url":"https://api.github.com/repos/Talend/components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Talend/components/labels{/name}","releases_url":"https://api.github.com/repos/Talend/components/releases{/id}","deployments_url":"https://api.github.com/repos/Talend/components/deployments","created_at":"2015-07-28T20:02:50Z","updated_at":"2016-09-22T09:46:28Z","pushed_at":"2016-09-23T07:08:16Z","git_url":"git://github.com/Talend/components.git","ssh_url":"git@github.com:Talend/components.git","clone_url":"https://github.com/Talend/components.git","svn_url":"https://github.com/Talend/components","homepage":null,"size":5785,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":12,"forks":16,"open_issues":12,"watchers":5,"default_branch":"master"}},"base":{"label":"Talend:master","ref":"master","sha":"81f55afd3a8ec12778b7a2f14c228913b447f48a","user":{"login":"Talend","id":459687,"avatar_url":"https://avatars.githubusercontent.com/u/459687?v=3","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"repo":{"id":39855061,"name":"components","full_name":"Talend/components","owner":{"login":"Talend","id":459687,"avatar_url":"https://avatars.githubusercontent.com/u/459687?v=3","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Talend/components","description":"Talend component infrastructure and public components","fork":false,"url":"https://api.github.com/repos/Talend/components","forks_url":"https://api.github.com/repos/Talend/components/forks","keys_url":"https://api.github.com/repos/Talend/components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Talend/components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Talend/components/teams","hooks_url":"https://api.github.com/repos/Talend/components/hooks","issue_events_url":"https://api.github.com/repos/Talend/components/issues/events{/number}","events_url":"https://api.github.com/repos/Talend/components/events","assignees_url":"https://api.github.com/repos/Talend/components/assignees{/user}","branches_url":"https://api.github.com/repos/Talend/components/branches{/branch}","tags_url":"https://api.github.com/repos/Talend/components/tags","blobs_url":"https://api.github.com/repos/Talend/components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Talend/components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Talend/components/git/refs{/sha}","trees_url":"https://api.github.com/repos/Talend/components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Talend/components/statuses/{sha}","languages_url":"https://api.github.com/repos/Talend/components/languages","stargazers_url":"https://api.github.com/repos/Talend/components/stargazers","contributors_url":"https://api.github.com/repos/Talend/components/contributors","subscribers_url":"https://api.github.com/repos/Talend/components/subscribers","subscription_url":"https://api.github.com/repos/Talend/components/subscription","commits_url":"https://api.github.com/repos/Talend/components/commits{/sha}","git_commits_url":"https://api.github.com/repos/Talend/components/git/commits{/sha}","comments_url":"https://api.github.com/repos/Talend/components/comments{/number}","issue_comment_url":"https://api.github.com/repos/Talend/components/issues/comments{/number}","contents_url":"https://api.github.com/repos/Talend/components/contents/{+path}","compare_url":"https://api.github.com/repos/Talend/components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Talend/components/merges","archive_url":"https://api.github.com/repos/Talend/components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Talend/components/downloads","issues_url":"https://api.github.com/repos/Talend/components/issues{/number}","pulls_url":"https://api.github.com/repos/Talend/components/pulls{/number}","milestones_url":"https://api.github.com/repos/Talend/components/milestones{/number}","notifications_url":"https://api.github.com/repos/Talend/components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Talend/components/labels{/name}","releases_url":"https://api.github.com/repos/Talend/components/releases{/id}","deployments_url":"https://api.github.com/repos/Talend/components/deployments","created_at":"2015-07-28T20:02:50Z","updated_at":"2016-09-22T09:46:28Z","pushed_at":"2016-09-23T07:08:16Z","git_url":"git://github.com/Talend/components.git","ssh_url":"git@github.com:Talend/components.git","clone_url":"https://github.com/Talend/components.git","svn_url":"https://github.com/Talend/components","homepage":null,"size":5785,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":12,"forks":16,"open_issues":12,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Talend/components/pulls/251"},"html":{"href":"https://github.com/Talend/components/pull/251"},"issue":{"href":"https://api.github.com/repos/Talend/components/issues/251"},"comments":{"href":"https://api.github.com/repos/Talend/components/issues/251/comments"},"review_comments":{"href":"https://api.github.com/repos/Talend/components/pulls/251/comments"},"review_comment":{"href":"https://api.github.com/repos/Talend/components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Talend/components/pulls/251/commits"},"statuses":{"href":"https://api.github.com/repos/Talend/components/statuses/e716b06b11cd690811faec5343955e4c6a8674d1"}}}}
{"actor":{"display_login":"gonchar-ivan"}}