{"action":"created","comment":{"url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls/comments/170364936","pull_request_review_id":99048435,"id":170364936,"diff_hunk":"@@ -0,0 +1,79 @@\n+package repository;\n+\n+import java.sql.Connection;\n+import java.sql.PreparedStatement;\n+import java.sql.ResultSet;\n+import java.sql.SQLException;\n+import java.util.ArrayList;\n+import java.util.Date;\n+import java.util.List;\n+\n+import model.*;\n+import connection.*;\n+\n+public class CompanyRepository extends Close {\n+\t\n+\tprivate static final String jdbcUrl = \"jdbc:h2:~/test\";\n+\tstatic ConnectionManager manager = new ConnectionH2();\n+\t\n+\tpublic static void deleteCompany(String nombre){\n+\t\tPreparedStatement preparedStatement = null;\n+\t\tConnection conn = manager.open(jdbcUrl);\n+\t\n+\t\ttry {\n+\t\t\tpreparedStatement = conn.prepareStatement(\"DELETE FROM company WHERE name = ?\");\n+\t\t\tpreparedStatement.setString(1, nombre);\n+\t\t\tpreparedStatement.execute();\n+\t\t} catch (SQLException e) {\n+\t\t\te.printStackTrace();\n+\t\t\tthrow new RuntimeException(e);\n+\t\t}finally {\n+\t\t\tclose(preparedStatement);\n+\t\t}\n+\t\t\n+\t\tmanager.close(conn);\n+\t} \n+\t\n+\tpublic static  List<Company> listAllCompany(){\n+\t\tList<Company> listAllCompanies = new ArrayList<Company>();\n+\t\tConnection conn = manager.open(jdbcUrl);\n+\t\tResultSet resultSet = null;\n+\t\tPreparedStatement preparedStatement = null;\n+\t\t\n+\t\ttry {\n+\t\t\tpreparedStatement = conn.prepareStatement(\"SELECT * FROM Company\");\n+\t\t\tresultSet = preparedStatement.executeQuery();\n+\t\t\twhile(resultSet.next()){\n+\t\t\t\tCompany userInDatabase = new Company();\n+\t\t\t\tuserInDatabase.setName(resultSet.getString(1));\n+\t\t\t\tuserInDatabase.setCreationDate(resultSet.getDate(2));\n+\t\t\t\tlistAllCompanies.add(userInDatabase);\n+\t\t\t}\n+\t\t} catch (SQLException e) {\n+\t\t\te.printStackTrace();\n+\t\t\tthrow new RuntimeException(e);\n+\t\t}finally {\n+\t\t\tclose(resultSet);\n+\t\t\tclose(preparedStatement);\n+\t\t}\n+\t    manager.close(conn);\n+\t    return listAllCompanies;\n+\t}\n+   \n+\tpublic static  void insertNewCompany(String nombre, Date fechaCreacion){\n+\t\tPreparedStatement preparedStatement = null;\n+\t\tConnection conn = manager.open(jdbcUrl);\n+\n+\t\ttry {\n+\t\t\tpreparedStatement = conn.prepareStatement(\"INSERT INTO Company (name, creationDate) VALUES (?,?)\");\n+\t\t\tpreparedStatement.setString(1, nombre);\n+\t\t\tpreparedStatement.execute();\n+\t\t} catch (SQLException e) {\n+\t\t\te.printStackTrace();\n+\t\t\tthrow new RuntimeException(e);\n+\t\t}finally {\n+\t\t\tclose(preparedStatement);","path":"src/main/java/repository/CompanyRepository.java","position":31,"original_position":75,"commit_id":"8f943e6fdac3563dbe643a02081350d2cd1cb354","original_commit_id":"8f943e6fdac3563dbe643a02081350d2cd1cb354","user":{"login":"JoTerrance","id":6041670,"avatar_url":"https://avatars0.githubusercontent.com/u/6041670?v=4","gravatar_id":"","url":"https://api.github.com/users/JoTerrance","html_url":"https://github.com/JoTerrance","followers_url":"https://api.github.com/users/JoTerrance/followers","following_url":"https://api.github.com/users/JoTerrance/following{/other_user}","gists_url":"https://api.github.com/users/JoTerrance/gists{/gist_id}","starred_url":"https://api.github.com/users/JoTerrance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoTerrance/subscriptions","organizations_url":"https://api.github.com/users/JoTerrance/orgs","repos_url":"https://api.github.com/users/JoTerrance/repos","events_url":"https://api.github.com/users/JoTerrance/events{/privacy}","received_events_url":"https://api.github.com/users/JoTerrance/received_events","type":"User","site_admin":false},"body":"los dos close en el finally\r\n","created_at":"2018-02-23T20:53:16Z","updated_at":"2018-02-23T20:53:44Z","html_url":"https://github.com/FPGS/SolucionExamenServlet/pull/52#discussion_r170364936","pull_request_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls/52","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls/comments/170364936"},"html":{"href":"https://github.com/FPGS/SolucionExamenServlet/pull/52#discussion_r170364936"},"pull_request":{"href":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls/52","id":170995104,"html_url":"https://github.com/FPGS/SolucionExamenServlet/pull/52","diff_url":"https://github.com/FPGS/SolucionExamenServlet/pull/52.diff","patch_url":"https://github.com/FPGS/SolucionExamenServlet/pull/52.patch","issue_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/issues/52","number":52,"state":"open","locked":false,"title":"Signed-off-by: Diego Abad Lacueva <Dal320@hotmail.com>","user":{"login":"Diego1696","id":24474405,"avatar_url":"https://avatars3.githubusercontent.com/u/24474405?v=4","gravatar_id":"","url":"https://api.github.com/users/Diego1696","html_url":"https://github.com/Diego1696","followers_url":"https://api.github.com/users/Diego1696/followers","following_url":"https://api.github.com/users/Diego1696/following{/other_user}","gists_url":"https://api.github.com/users/Diego1696/gists{/gist_id}","starred_url":"https://api.github.com/users/Diego1696/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Diego1696/subscriptions","organizations_url":"https://api.github.com/users/Diego1696/orgs","repos_url":"https://api.github.com/users/Diego1696/repos","events_url":"https://api.github.com/users/Diego1696/events{/privacy}","received_events_url":"https://api.github.com/users/Diego1696/received_events","type":"User","site_admin":false},"body":"Ahi lo dejo","created_at":"2018-02-23T11:41:18Z","updated_at":"2018-02-23T20:53:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55f4ec8b01ddd745dac41b419b6056e994787f9a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls/52/commits","review_comments_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls/52/comments","review_comment_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/issues/52/comments","statuses_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/statuses/8f943e6fdac3563dbe643a02081350d2cd1cb354","head":{"label":"Diego1696:master","ref":"master","sha":"8f943e6fdac3563dbe643a02081350d2cd1cb354","user":{"login":"Diego1696","id":24474405,"avatar_url":"https://avatars3.githubusercontent.com/u/24474405?v=4","gravatar_id":"","url":"https://api.github.com/users/Diego1696","html_url":"https://github.com/Diego1696","followers_url":"https://api.github.com/users/Diego1696/followers","following_url":"https://api.github.com/users/Diego1696/following{/other_user}","gists_url":"https://api.github.com/users/Diego1696/gists{/gist_id}","starred_url":"https://api.github.com/users/Diego1696/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Diego1696/subscriptions","organizations_url":"https://api.github.com/users/Diego1696/orgs","repos_url":"https://api.github.com/users/Diego1696/repos","events_url":"https://api.github.com/users/Diego1696/events{/privacy}","received_events_url":"https://api.github.com/users/Diego1696/received_events","type":"User","site_admin":false},"repo":{"id":122612803,"name":"SolucionExamenServlet","full_name":"Diego1696/SolucionExamenServlet","owner":{"login":"Diego1696","id":24474405,"avatar_url":"https://avatars3.githubusercontent.com/u/24474405?v=4","gravatar_id":"","url":"https://api.github.com/users/Diego1696","html_url":"https://github.com/Diego1696","followers_url":"https://api.github.com/users/Diego1696/followers","following_url":"https://api.github.com/users/Diego1696/following{/other_user}","gists_url":"https://api.github.com/users/Diego1696/gists{/gist_id}","starred_url":"https://api.github.com/users/Diego1696/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Diego1696/subscriptions","organizations_url":"https://api.github.com/users/Diego1696/orgs","repos_url":"https://api.github.com/users/Diego1696/repos","events_url":"https://api.github.com/users/Diego1696/events{/privacy}","received_events_url":"https://api.github.com/users/Diego1696/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Diego1696/SolucionExamenServlet","description":null,"fork":true,"url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet","forks_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/forks","keys_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/teams","hooks_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/hooks","issue_events_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/issues/events{/number}","events_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/events","assignees_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/assignees{/user}","branches_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/branches{/branch}","tags_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/tags","blobs_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/statuses/{sha}","languages_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/languages","stargazers_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/stargazers","contributors_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/contributors","subscribers_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/subscribers","subscription_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/subscription","commits_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/contents/{+path}","compare_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/merges","archive_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/downloads","issues_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/issues{/number}","pulls_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/pulls{/number}","milestones_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/milestones{/number}","notifications_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/labels{/name}","releases_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/releases{/id}","deployments_url":"https://api.github.com/repos/Diego1696/SolucionExamenServlet/deployments","created_at":"2018-02-23T11:27:07Z","updated_at":"2018-02-23T11:38:51Z","pushed_at":"2018-02-23T11:38:49Z","git_url":"git://github.com/Diego1696/SolucionExamenServlet.git","ssh_url":"git@github.com:Diego1696/SolucionExamenServlet.git","clone_url":"https://github.com/Diego1696/SolucionExamenServlet.git","svn_url":"https://github.com/Diego1696/SolucionExamenServlet","homepage":null,"size":10,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"FPGS:master","ref":"master","sha":"dbfd23a88366034109f2dfe4af17822aa337fcb5","user":{"login":"FPGS","id":16159865,"avatar_url":"https://avatars0.githubusercontent.com/u/16159865?v=4","gravatar_id":"","url":"https://api.github.com/users/FPGS","html_url":"https://github.com/FPGS","followers_url":"https://api.github.com/users/FPGS/followers","following_url":"https://api.github.com/users/FPGS/following{/other_user}","gists_url":"https://api.github.com/users/FPGS/gists{/gist_id}","starred_url":"https://api.github.com/users/FPGS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FPGS/subscriptions","organizations_url":"https://api.github.com/users/FPGS/orgs","repos_url":"https://api.github.com/users/FPGS/repos","events_url":"https://api.github.com/users/FPGS/events{/privacy}","received_events_url":"https://api.github.com/users/FPGS/received_events","type":"Organization","site_admin":false},"repo":{"id":114757631,"name":"SolucionExamenServlet","full_name":"FPGS/SolucionExamenServlet","owner":{"login":"FPGS","id":16159865,"avatar_url":"https://avatars0.githubusercontent.com/u/16159865?v=4","gravatar_id":"","url":"https://api.github.com/users/FPGS","html_url":"https://github.com/FPGS","followers_url":"https://api.github.com/users/FPGS/followers","following_url":"https://api.github.com/users/FPGS/following{/other_user}","gists_url":"https://api.github.com/users/FPGS/gists{/gist_id}","starred_url":"https://api.github.com/users/FPGS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FPGS/subscriptions","organizations_url":"https://api.github.com/users/FPGS/orgs","repos_url":"https://api.github.com/users/FPGS/repos","events_url":"https://api.github.com/users/FPGS/events{/privacy}","received_events_url":"https://api.github.com/users/FPGS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FPGS/SolucionExamenServlet","description":null,"fork":false,"url":"https://api.github.com/repos/FPGS/SolucionExamenServlet","forks_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/forks","keys_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/teams","hooks_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/hooks","issue_events_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/issues/events{/number}","events_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/events","assignees_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/assignees{/user}","branches_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/branches{/branch}","tags_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/tags","blobs_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/git/refs{/sha}","trees_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/statuses/{sha}","languages_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/languages","stargazers_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/stargazers","contributors_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/contributors","subscribers_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/subscribers","subscription_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/subscription","commits_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/commits{/sha}","git_commits_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/git/commits{/sha}","comments_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/comments{/number}","issue_comment_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/issues/comments{/number}","contents_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/contents/{+path}","compare_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/merges","archive_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/downloads","issues_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/issues{/number}","pulls_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls{/number}","milestones_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/milestones{/number}","notifications_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/labels{/name}","releases_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/releases{/id}","deployments_url":"https://api.github.com/repos/FPGS/SolucionExamenServlet/deployments","created_at":"2017-12-19T11:33:05Z","updated_at":"2017-12-19T11:33:05Z","pushed_at":"2018-02-23T19:09:45Z","git_url":"git://github.com/FPGS/SolucionExamenServlet.git","ssh_url":"git@github.com:FPGS/SolucionExamenServlet.git","clone_url":"https://github.com/FPGS/SolucionExamenServlet.git","svn_url":"https://github.com/FPGS/SolucionExamenServlet","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":17,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls/52"},"html":{"href":"https://github.com/FPGS/SolucionExamenServlet/pull/52"},"issue":{"href":"https://api.github.com/repos/FPGS/SolucionExamenServlet/issues/52"},"comments":{"href":"https://api.github.com/repos/FPGS/SolucionExamenServlet/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FPGS/SolucionExamenServlet/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/FPGS/SolucionExamenServlet/statuses/8f943e6fdac3563dbe643a02081350d2cd1cb354"}},"author_association":"NONE"}}
{"actor":{"display_login":"JoTerrance"}}