# 6.2.5 JDBC MySQL Connector - Cannot SELECT

**URL:** https://community.ofelia.com/t/6-2-5-jdbc-mysql-connector-cannot-select/4655
**Category:** Q&A
**Created:** [4 June 2014 18:52 UTC](https://community.ofelia.com/t/6-2-5-jdbc-mysql-connector-cannot-select/4655 "2014-06-04T18:52:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mike.hopkins](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@mike.hopkins](https://community.ofelia.com/u/mike.hopkins)
#### Post date: [4 June 2014 18:52 UTC](https://community.ofelia.com/t/6-2-5-jdbc-mysql-connector-cannot-select/4655/1 "2014-06-04T18:52:02Z")

</div>

I’ve created a simple process using the standard, out-of-the box JDBC MySQL connector. I entered a simple SELECT statement in the connector, and I get the following error:

org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.bonitasoft.engine.connector.ConnectorException: java.sql.BatchUpdateException: Can not issue SELECT via executeUpdate().

Strangely, any INSERT statements work just fine.

I’ve researched for hours to no avail. I’m assuming I have some kind of configuration problem, or perhaps system incompatibility?

BOS installed from the BonitaBPMCommunity-6.2.5 bundle. MySQL version 5.5.37. Tested on both Ubuntu 14 and MacOS.

---

<div class="post-metadata">

### Author: ![marcostang2002](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@marcostang2002](https://community.ofelia.com/u/marcostang2002)
#### Post date: [17 June 2014 18:31 UTC](https://community.ofelia.com/t/6-2-5-jdbc-mysql-connector-cannot-select/4655/2 "2014-06-17T18:31:29Z")

</div>

I have the same problem and I find out I have “;” inside the “Command separator” field when I create the MySQL connector. I remove the “;” and it works for me.  
If you have “;” defined inside your MySQL connector, try remove it.

Marcos

---

<div class="post-metadata">

### Author: ![yannick.lombardi](https://avatars.discourse-cdn.com/v4/letter/y/8e8cbc/32.png) [@yannick.lombardi](https://community.ofelia.com/u/yannick.lombardi)
#### Post date: [4 August 2014 12:57 UTC](https://community.ofelia.com/t/6-2-5-jdbc-mysql-connector-cannot-select/4655/3 "2014-08-04T12:57:38Z")

</div>

Hi,

I have the same problem with 6.3.1.  
In my query I insert a new line in a table and then I select max(id) from this table.

INSERT INTO table (col1, col2) VALUES (val1, val2); SELECT max(id) FROM table

org.bonitasoft.engine.connector.ConnectorException: java.sql.BatchUpdateException: Can not issue SELECT via executeUpdate().

I try Marcos’s solution but it doesn’t work for me :  
org.bonitasoft.engine.connector.ConnectorException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘SELECT max(id) FROM table’ at line 2

---

<div class="post-metadata">

### Author: ![yannick.lombardi](https://avatars.discourse-cdn.com/v4/letter/y/8e8cbc/32.png) [@yannick.lombardi](https://community.ofelia.com/u/yannick.lombardi)
#### Post date: [4 August 2014 12:59 UTC](https://community.ofelia.com/t/6-2-5-jdbc-mysql-connector-cannot-select/4655/4 "2014-08-04T12:59:07Z")

</div>

This query works if I copy/paste it in phpmyadmin.  
It doesn’t work only in Bonita mysql connector.

---

<div class="post-metadata">

### Author: ![aCordier](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@aCordier](https://community.ofelia.com/u/aCordier)
#### Post date: [6 August 2014 06:31 UTC](https://community.ofelia.com/t/6-2-5-jdbc-mysql-connector-cannot-select/4655/5 "2014-08-06T06:31:10Z")

</div>

Hello, this must be related to the fact that JDBC batch execution cannot handle SELECT. SELECT queries return a resultset while executeBatch returns an array of int corresponding to the number of updated records for each statement. Therefore, you can not put a SELECT query as a member of a batch update.

---

<div class="post-metadata">

### Author: ![yannick.lombardi](https://avatars.discourse-cdn.com/v4/letter/y/8e8cbc/32.png) [@yannick.lombardi](https://community.ofelia.com/u/yannick.lombardi)
#### Post date: [6 August 2014 06:42 UTC](https://community.ofelia.com/t/6-2-5-jdbc-mysql-connector-cannot-select/4655/6 "2014-08-06T06:42:43Z")

</div>

Ok.  
I cut my query into two successive connectors to avoid this problem.
