You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/05/15 11:57:34 UTC

[GitHub] [shardingsphere] heysJava opened a new issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

heysJava opened a new issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353


   public ShardingSphereStatement(final ShardingSphereConnection connection) {
           this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
       }
   
   Excuse me, why the three parameters are fixed in this method


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] SteNicholas removed a comment on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
SteNicholas removed a comment on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-842015178


   > > @heysJava , the default behavior value of above three parameters are `ResultSet.TYPE_FORWARD_ONLY`, `ResultSet.CONCUR_READ_ONLY`, `ResultSet.HOLD_CURSORS_OVER_COMMIT`. Users could specific the value of the parameters.
   > 
   > @SteNicholas ,How do users specify these parameter values? When using the qurey method of jdbcTemplate, connection.createStatement() will be used. This method calls the createStatement() method in the ShardingSphereConnection class, and it will be new ShardingSphereStatement(this); that is this way
   > public ShardingSphereStatement(final ShardingSphereConnection connection) {
   > this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
   > }
   > These parameter values ​​are fixed. When users want to use this method, they cannot pass custom parameter values. If you want to change this parameter value, you need to change the source code of jdbcTemplate or the source code of Shardingsphere. I feel that this method is very unfriendly. There is no other way to avoid
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] SteNicholas removed a comment on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
SteNicholas removed a comment on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-842875111


   @heysJava , do you have other problem for `ShardingSphereStatement`? If you have no question about this, please close this issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] SteNicholas edited a comment on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
SteNicholas edited a comment on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-842875111


   @heysJava , do you have other problem for `ShardingSphereStatement`? If you have no question about this, please close this issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] SteNicholas closed issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
SteNicholas closed issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] heysJava commented on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
heysJava commented on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-841760981


   
   
   
   
   > @heysJava , the default behavior value of above three parameters are `ResultSet.TYPE_FORWARD_ONLY`, `ResultSet.CONCUR_READ_ONLY`, `ResultSet.HOLD_CURSORS_OVER_COMMIT`. Users could specific the value of the parameters.
   
   @SteNicholas ,How do users specify these parameter values? When using the qurey method of jdbcTemplate, connection.createStatement() will be used. This method calls the createStatement() method in the ShardingSphereConnection class, and it will be new ShardingSphereStatement(this); that is this way
   public ShardingSphereStatement(final ShardingSphereConnection connection) {
           this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
       }
   These parameter values ​​are fixed. When users want to use this method, they cannot pass custom parameter values. If you want to change this parameter value, you need to change the source code of jdbcTemplate or the source code of Shardingsphere. I feel that this method is very unfriendly. There is no other way to avoid


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] SteNicholas commented on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-841755052






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] SteNicholas commented on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-842875111


   @heysJava , do you have other problem for this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] SteNicholas closed issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
SteNicholas closed issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] heysJava commented on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
heysJava commented on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-841760981


   
   
   
   
   > @heysJava , the default behavior value of above three parameters are `ResultSet.TYPE_FORWARD_ONLY`, `ResultSet.CONCUR_READ_ONLY`, `ResultSet.HOLD_CURSORS_OVER_COMMIT`. Users could specific the value of the parameters.
   
   @SteNicholas ,How do users specify these parameter values? When using the qurey method of jdbcTemplate, connection.createStatement() will be used. This method calls the createStatement() method in the ShardingSphereConnection class, and it will be new ShardingSphereStatement(this); that is this way
   public ShardingSphereStatement(final ShardingSphereConnection connection) {
           this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
       }
   These parameter values ​​are fixed. When users want to use this method, they cannot pass custom parameter values. If you want to change this parameter value, you need to change the source code of jdbcTemplate or the source code of Shardingsphere. I feel that this method is very unfriendly. There is no other way to avoid


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] SteNicholas closed issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
SteNicholas closed issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] SteNicholas commented on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-842876535


   > @heysJava Hi, I have checked the Connection implementation of MySQL JDBC driver. By default, similar parameter settings are also provided.
   > 
   > ```java
   > private static final int DEFAULT_RESULT_SET_TYPE = ResultSet.TYPE_FORWARD_ONLY;
   > 
   > private static final int DEFAULT_RESULT_SET_CONCURRENCY = ResultSet.CONCUR_READ_ONLY;
   > 
   > /**
   >  * SQL statements without parameters are normally executed using Statement
   >  * objects. If the same SQL statement is executed many times, it is more
   >  * efficient to use a PreparedStatement
   >  * 
   >  * @return a new Statement object
   >  * @throws SQLException
   >  *             passed through from the constructor
   >  */
   > public java.sql.Statement createStatement() throws SQLException {
   >     return createStatement(DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY);
   > }
   > ```
   > 
   > Besides, the `ShardingSphereConnection` class provides multiple createStatement overload methods to support user-specified parameters. I think you should check the Spring `JdbcTemplate` documentation to see whether it provides relevant methods to call other overloaded methods.
   
   @heysJava, do you have other problem for `ShardingSphereStatement`? If you have no question about this, please close this issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-841966098


   @heysJava Hi, I have checked the Connection implementation of MySQL JDBC driver. By default, similar parameter settings are also provided.
   
   ```java
   private static final int DEFAULT_RESULT_SET_TYPE = ResultSet.TYPE_FORWARD_ONLY;
   
   private static final int DEFAULT_RESULT_SET_CONCURRENCY = ResultSet.CONCUR_READ_ONLY;
   
   /**
    * SQL statements without parameters are normally executed using Statement
    * objects. If the same SQL statement is executed many times, it is more
    * efficient to use a PreparedStatement
    * 
    * @return a new Statement object
    * @throws SQLException
    *             passed through from the constructor
    */
   public java.sql.Statement createStatement() throws SQLException {
       return createStatement(DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY);
   }
   ```
   
   Besides, the `ShardingSphereConnection` class provides multiple createStatement overload methods to support user-specified parameters. I think you should check the Spring `JdbcTemplate` documentation to see whether it provides relevant methods to call other overloaded methods.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] SteNicholas commented on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-842015178


   > > @heysJava , the default behavior value of above three parameters are `ResultSet.TYPE_FORWARD_ONLY`, `ResultSet.CONCUR_READ_ONLY`, `ResultSet.HOLD_CURSORS_OVER_COMMIT`. Users could specific the value of the parameters.
   > 
   > @SteNicholas ,How do users specify these parameter values? When using the qurey method of jdbcTemplate, connection.createStatement() will be used. This method calls the createStatement() method in the ShardingSphereConnection class, and it will be new ShardingSphereStatement(this); that is this way
   > public ShardingSphereStatement(final ShardingSphereConnection connection) {
   > this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
   > }
   > These parameter values ​​are fixed. When users want to use this method, they cannot pass custom parameter values. If you want to change this parameter value, you need to change the source code of jdbcTemplate or the source code of Shardingsphere. I feel that this method is very unfriendly. There is no other way to avoid
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-841966098


   @heysJava Hi, I have checked the Connection implementation of MySQL JDBC driver. By default, similar parameter settings are also provided.
   
   ```java
   private static final int DEFAULT_RESULT_SET_TYPE = ResultSet.TYPE_FORWARD_ONLY;
   
   private static final int DEFAULT_RESULT_SET_CONCURRENCY = ResultSet.CONCUR_READ_ONLY;
   
   /**
    * SQL statements without parameters are normally executed using Statement
    * objects. If the same SQL statement is executed many times, it is more
    * efficient to use a PreparedStatement
    * 
    * @return a new Statement object
    * @throws SQLException
    *             passed through from the constructor
    */
   public java.sql.Statement createStatement() throws SQLException {
       return createStatement(DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY);
   }
   ```
   
   Besides, the `ShardingSphereConnection` class provides multiple createStatement overload methods to support user-specified parameters. I think you should check the Spring `JdbcTemplate` documentation to see whether it provides relevant methods to call other overloaded methods.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] SteNicholas removed a comment on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
SteNicholas removed a comment on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-842015178


   > > @heysJava , the default behavior value of above three parameters are `ResultSet.TYPE_FORWARD_ONLY`, `ResultSet.CONCUR_READ_ONLY`, `ResultSet.HOLD_CURSORS_OVER_COMMIT`. Users could specific the value of the parameters.
   > 
   > @SteNicholas ,How do users specify these parameter values? When using the qurey method of jdbcTemplate, connection.createStatement() will be used. This method calls the createStatement() method in the ShardingSphereConnection class, and it will be new ShardingSphereStatement(this); that is this way
   > public ShardingSphereStatement(final ShardingSphereConnection connection) {
   > this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
   > }
   > These parameter values ​​are fixed. When users want to use this method, they cannot pass custom parameter values. If you want to change this parameter value, you need to change the source code of jdbcTemplate or the source code of Shardingsphere. I feel that this method is very unfriendly. There is no other way to avoid
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] SteNicholas commented on issue #10353: this(connection, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);

Posted by GitBox <gi...@apache.org>.
SteNicholas commented on issue #10353:
URL: https://github.com/apache/shardingsphere/issues/10353#issuecomment-841755052






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org