You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Xiangdong Huang (Jira)" <ji...@apache.org> on 2020/04/17 07:30:00 UTC
[jira] [Commented] (IOTDB-426) when user execute a dml statement
there is a wrong status code.
[ https://issues.apache.org/jira/browse/IOTDB-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17085509#comment-17085509 ]
Xiangdong Huang commented on IOTDB-426:
---------------------------------------
To comply the JDBC standard, the `statement.executeUpdate(SQL)` needs to be reimplemented:
Javadoc:
/**
* Executes the given SQL statement, which may be an <code>INSERT</code>,
* <code>UPDATE</code>, or <code>DELETE</code> statement or an
* SQL statement that returns nothing, such as an SQL DDL statement.
*<p>
* <strong>Note:</strong>This method cannot be called on a
* <code>PreparedStatement</code> or <code>CallableStatement</code>.
* @param sql an SQL Data Manipulation Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or
* <code>DELETE</code>; or an SQL statement that returns nothing,
* such as a DDL statement.
*
** @return either (1) the row count for SQL Data Manipulation Language (DML) statements*
** or (2) 0 for SQL statements that return nothing*
*
* @exception SQLException if a database access error occurs,
* this method is called on a closed <code>Statement</code>, the given
* SQL statement produces a <code>ResultSet</code> object, the method is called on a
* <code>PreparedStatement</code> or <code>CallableStatement</code>
* @throws SQLTimeoutException when the driver has determined that the
* timeout value that was specified by the \{@code setQueryTimeout}
* method has been exceeded and has at least attempted to cancel
* the currently running \{@code Statement}
*/
> when user execute a dml statement there is a wrong status code.
> ---------------------------------------------------------------
>
> Key: IOTDB-426
> URL: https://issues.apache.org/jira/browse/IOTDB-426
> Project: Apache IoTDB
> Issue Type: Task
> Environment: centos7
> Reporter: lming
> Priority: Major
> Labels: JDBC
>
> In tranditionly relational database , execute ddl statement and dml statement could get back the different status code , so I think 'set storage group ' and 'create timeseries' is ddl statment , 'insert into ' is dml statement like postgresql and other relational database. When JDBC execute ddl there is a code only zero means control a relation but not records , then JDBC execute dml there is a code with integer means how many records be updated.
> But in release 0.9.0 jdbc execute ddl statement returen zero.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)