{"action":"created","issue":{"url":"https://api.github.com/repos/prestodb/presto/issues/1195","repository_url":"https://api.github.com/repos/prestodb/presto","labels_url":"https://api.github.com/repos/prestodb/presto/issues/1195/labels{/name}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/1195/comments","events_url":"https://api.github.com/repos/prestodb/presto/issues/1195/events","html_url":"https://github.com/prestodb/presto/issues/1195","id":31527203,"number":1195,"title":"Add support for prepared statements in JDBC driver","user":{"login":"felika","id":5763167,"avatar_url":"https://avatars.githubusercontent.com/u/5763167?v=3","gravatar_id":"","url":"https://api.github.com/users/felika","html_url":"https://github.com/felika","followers_url":"https://api.github.com/users/felika/followers","following_url":"https://api.github.com/users/felika/following{/other_user}","gists_url":"https://api.github.com/users/felika/gists{/gist_id}","starred_url":"https://api.github.com/users/felika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felika/subscriptions","organizations_url":"https://api.github.com/users/felika/orgs","repos_url":"https://api.github.com/users/felika/repos","events_url":"https://api.github.com/users/felika/events{/privacy}","received_events_url":"https://api.github.com/users/felika/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":21,"created_at":"2014-04-15T05:27:57Z","updated_at":"2016-11-29T14:25:10Z","closed_at":null,"body":"I'm using presto-jdbc-0.66-SNAPSHOT.jar, and trying to execute presto query to presto-server on my java application.\n\nBelow sample code, using jdbc statement, is working well.\n\n```\n    Class.forName(\"com.facebook.presto.jdbc.PrestoDriver\");\n    Connection connection = DriverManager.getConnection(\"jdbc:presto://192.168.33.33:8080/hive/default\", \"hive\", \"hive\");\n\n    Statement statement = connection.createStatement();\n    ResultSet rs = statement.executeQuery(\"SHOW TABLES\");\n    while(rs.next()) {\n        System.out.println(rs.getString(1));\n    }\n```\n\nHowever, using jdbc preparedstatement, throw exception.\nIs presto-jdbc not support yet \"preparedstatement\" ?\nHere's my test code and exception info.\n\nTest Code : \n\n```\n    Class.forName(\"com.facebook.presto.jdbc.PrestoDriver\");\n    Connection connection = DriverManager.getConnection(\"jdbc:presto://192.168.33.33:8080/hive/default\", \"hive\", \"hive\");\n\n    PreparedStatement ps = connection.prepareStatement(\"SHOW TABLES\");\n    ResultSet rs = ps.executeQuery();\n    while(rs.next()) {\n        System.out.println(rs.getString(1));\n    }\n```\n\nException Info : \n\n```\n    java.lang.UnsupportedOperationException: PreparedStatement\nat com.facebook.presto.jdbc.PrestoPreparedStatement.<init>(PrestoPreparedStatement.java:44)\nat com.facebook.presto.jdbc.PrestoConnection.prepareStatement(PrestoConnection.java:93)\nat com.nsouls.frescott.hive.mapper.PrestoConnectionTest.testShowTable(PrestoConnectionTest.java:37)\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\nat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)\nat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)\nat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)\nat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)\nat org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)\nat org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)\nat org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)\nat org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)\nat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)\nat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)\nat org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)\nat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)\nat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)\nat org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)\nat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)\nat org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)\nat org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)\nat org.junit.runners.ParentRunner.run(ParentRunner.java:300)\nat org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)\nat org.junit.runner.JUnitCore.run(JUnitCore.java:157)\nat com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)\nat com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)\nat com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\nat com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)\n```\n"},"comment":{"url":"https://api.github.com/repos/prestodb/presto/issues/comments/263583305","html_url":"https://github.com/prestodb/presto/issues/1195#issuecomment-263583305","issue_url":"https://api.github.com/repos/prestodb/presto/issues/1195","id":263583305,"user":{"login":"cawallin","id":3652644,"avatar_url":"https://avatars.githubusercontent.com/u/3652644?v=3","gravatar_id":"","url":"https://api.github.com/users/cawallin","html_url":"https://github.com/cawallin","followers_url":"https://api.github.com/users/cawallin/followers","following_url":"https://api.github.com/users/cawallin/following{/other_user}","gists_url":"https://api.github.com/users/cawallin/gists{/gist_id}","starred_url":"https://api.github.com/users/cawallin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cawallin/subscriptions","organizations_url":"https://api.github.com/users/cawallin/orgs","repos_url":"https://api.github.com/users/cawallin/repos","events_url":"https://api.github.com/users/cawallin/events{/privacy}","received_events_url":"https://api.github.com/users/cawallin/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T14:25:10Z","updated_at":"2016-11-29T14:25:10Z","body":"@handsetvn -- can you file a new issue with the query that failed and the full stacktrace? Your problem seems unrelated to this issue."}}
{"actor":{"display_login":"cawallin"}}