title: Presto JDBC Data Source Error in Intellij
body: <p>Anyone know how to add a Presto data source to IntelliJ? The Database Tool Window has lots of Data Source type options, but doesn't have one for a Presto Data Source.</p>
  
  <p>I checked the IntelliJ site and there seems to be no support as of yet. Wondering if there's a way to add it anyway so I can query from IntelliJ using Presto.</p>
  
  <p>When I try adding the Presto driver manually using "Add Datasource", I get the following when I try to "Test Connection":</p>
  
  <pre><code>java.lang.StringIndexOutOfBoundsException: String index out of range: -5
      at java.lang.String.substring(String.java:1931)
      at com.facebook.presto.jdbc.PrestoDriverUri.parseDriverUrl(PrestoDriverUri.java:195)
      at com.facebook.presto.jdbc.PrestoDriverUri.&lt;init&gt;(PrestoDriverUri.java:79)
      at com.facebook.presto.jdbc.PrestoDriver.getPropertyInfo(PrestoDriver.java:106)
      at com.intellij.database.remote.jdbc.impl.RemoteDriverImpl.getPropertyInfo(RemoteDriverImpl.java:61)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)
      at sun.rmi.transport.Transport$1.run(Transport.java:200)
      at sun.rmi.transport.Transport$1.run(Transport.java:197)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
      at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
      at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
      at com.sun.proxy.$Proxy196.getPropertyInfo(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.intellij.execution.rmi.RemoteUtil.invokeRemote(RemoteUtil.java:175)
      at com.intellij.execution.rmi.RemoteUtil.access$300(RemoteUtil.java:36)
      at com.intellij.execution.rmi.RemoteUtil$RemoteInvocationHandler.invoke(RemoteUtil.java:280)
      at com.sun.proxy.$Proxy197.getPropertyInfo(Unknown Source)
      at com.intellij.database.view.ui.DatabaseDriverPropertiesPanel.lambda$null$0(DatabaseDriverPropertiesPanel.java:223)
      at com.intellij.database.dataSource.DatabaseConnectionManager.useDriver(DatabaseConnectionManager.java:145)
      at com.intellij.database.view.ui.DatabaseDriverPropertiesPanel.lambda$refreshAdvancedProperties$2(DatabaseDriverPropertiesPanel.java:222)
      at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:330)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745) (no stack trace)
  </code></pre>