java.sql.SQLException: Error executing update

Couchbase JIRA | Raju Suravarjjala | 9 months ago
  1. 0

    Steps to reproduce: Run the following program with build 1854 import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; /* * This example shows * a) How to run a simple SELECT statement using the Couchbase JDBC driver. * b) How to retrieve scalar field values from the rows. */ public class SimpleSelects { static String ConnectionURL = "jdbc:couchbase://172.23.123.107:8093"; public static void main(String[] args) throws Exception { Connection con = DriverManager.getConnection(ConnectionURL); Statement stmt = con.createStatement(); ResultSet rs = stmt .executeQuery("select name, abv, (abv > 5) as strong from `beer-sample` where type = 'beer' limit 10"); /*ResultSet rs = stmt .executeQuery("select count(*) as MYCOUNT from `mobile` limit 10");*/ System.out.println("TEN BEERS"); while (rs.next()) { //String name = rs.getString("name"); double abv = rs.getDouble("MYCOUNT"); //boolean strong = rs.getBoolean("strong"); //System.out.println("name: " + name + ", abv: " + abv + ", strong: " + strong); System.out.println("MYCOUNT: " + abv); } System.out.println(); /* rs = stmt.executeQuery("select category, count(*) as num from `beer-sample` where type = 'beer' group by category"); System.out.println("BEER CATEGORIES"); while (rs.next()) { System.out.println(rs.getString("category") + ": " + rs.getInt("num")); }*/ } } Here is the error I am getting LF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/Users/raju/Downloads/test/jdbc-cb/target/jdbc-cb-0.4.1-SNAPSHOT.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/Users/raju/Downloads/slf4j-1.7.13/slf4j-jdk14-1.7.13.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/Users/raju/Downloads/slf4j-1.7.13/slf4j-simple-1.7.13.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder] 11:24:54.979 [main] INFO com.couchbase.CBDriver - Constructor called 11:24:54.982 [main] INFO com.couchbase.CBDriver - Constructor called 11:24:55.359 [main] ERROR com.couchbase.jdbc.core.ProtocolImpl - Error executing query [select name, abv, (abv > 5) as strong from `beer-sample` where type = 'beer' limit 10] Connect to 127.0.0.1:8093 [/127.0.0.1] failed: Connection refused Exception in thread "main" java.sql.SQLException: Error executing update at com.couchbase.jdbc.core.ProtocolImpl.query(ProtocolImpl.java:348) at com.couchbase.CBStatement.executeQuery(CBStatement.java:75) at SimpleSelects.main(SimpleSelects.java:20) Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107) at com.couchbase.jdbc.core.ProtocolImpl.query(ProtocolImpl.java:330)

    Couchbase JIRA | 9 months ago | Raju Suravarjjala
    java.sql.SQLException: Error executing update
  2. 0

    Steps to reproduce: Run the following program with build 1854 import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; /* * This example shows * a) How to run a simple SELECT statement using the Couchbase JDBC driver. * b) How to retrieve scalar field values from the rows. */ public class SimpleSelects { static String ConnectionURL = "jdbc:couchbase://172.23.123.107:8093"; public static void main(String[] args) throws Exception { Connection con = DriverManager.getConnection(ConnectionURL); Statement stmt = con.createStatement(); ResultSet rs = stmt .executeQuery("select name, abv, (abv > 5) as strong from `beer-sample` where type = 'beer' limit 10"); /*ResultSet rs = stmt .executeQuery("select count(*) as MYCOUNT from `mobile` limit 10");*/ System.out.println("TEN BEERS"); while (rs.next()) { //String name = rs.getString("name"); double abv = rs.getDouble("MYCOUNT"); //boolean strong = rs.getBoolean("strong"); //System.out.println("name: " + name + ", abv: " + abv + ", strong: " + strong); System.out.println("MYCOUNT: " + abv); } System.out.println(); /* rs = stmt.executeQuery("select category, count(*) as num from `beer-sample` where type = 'beer' group by category"); System.out.println("BEER CATEGORIES"); while (rs.next()) { System.out.println(rs.getString("category") + ": " + rs.getInt("num")); }*/ } } Here is the error I am getting LF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/Users/raju/Downloads/test/jdbc-cb/target/jdbc-cb-0.4.1-SNAPSHOT.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/Users/raju/Downloads/slf4j-1.7.13/slf4j-jdk14-1.7.13.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/Users/raju/Downloads/slf4j-1.7.13/slf4j-simple-1.7.13.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder] 11:24:54.979 [main] INFO com.couchbase.CBDriver - Constructor called 11:24:54.982 [main] INFO com.couchbase.CBDriver - Constructor called 11:24:55.359 [main] ERROR com.couchbase.jdbc.core.ProtocolImpl - Error executing query [select name, abv, (abv > 5) as strong from `beer-sample` where type = 'beer' limit 10] Connect to 127.0.0.1:8093 [/127.0.0.1] failed: Connection refused Exception in thread "main" java.sql.SQLException: Error executing update at com.couchbase.jdbc.core.ProtocolImpl.query(ProtocolImpl.java:348) at com.couchbase.CBStatement.executeQuery(CBStatement.java:75) at SimpleSelects.main(SimpleSelects.java:20) Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107) at com.couchbase.jdbc.core.ProtocolImpl.query(ProtocolImpl.java:330)

    Couchbase JIRA | 9 months ago | Raju Suravarjjala
    java.sql.SQLException: Error executing update
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  1. tvrmsmith 2 times, last 3 weeks ago
  2. mauritius 2 times, last 2 weeks ago
  3. tvrmsmith 1 times, last 1 month ago
  4. Nikolay Rybak 4 times, last 5 months ago
  5. jedcua 1 times, last 5 months ago
44 more registered users
47 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.ConnectException

    Connection refused

    at java.net.PlainSocketImpl.socketConnect()
  2. Java RT
    Socket.connect
    1. java.net.PlainSocketImpl.socketConnect(Native Method)
    2. java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    3. java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    4. java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    5. java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    6. java.net.Socket.connect(Socket.java:589)
    6 frames
  3. Apache HttpClient
    CloseableHttpClient.execute
    1. org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)
    2. org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
    3. org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
    4. org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
    5. org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    6. org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    7. org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
    8. org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    9. org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    10. org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    11. org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
    11 frames
  4. com.couchbase.jdbc
    ProtocolImpl.query
    1. com.couchbase.jdbc.core.ProtocolImpl.query(ProtocolImpl.java:330)
    1 frame