[CONJ-69] open statement when the connection is closed Created: 2013-10-10  Updated: 2014-10-21  Resolved: 2014-10-21

Status: Closed
Project: MariaDB Connector/J
Component/s: None
Affects Version/s: 1.1.5
Fix Version/s: 1.1.8

Type: Bug Priority: Major
Reporter: nzanaga Assignee: Massimo Siani (Inactive)
Resolution: Fixed Votes: 0
Labels: connection, statement


 Description   

The Connection.createStatement() return a statement even if the connection is closed.
It should give an error when try to get a statement on close connection.

Below sample code:

Properties props = new Properties();
props.put("user", "test1");
props.put("password", "test1");
Connection connection = java.sql.DriverManager.getConnection("jdbc:mariadb://192.168.53.30:3306/test1", props);

Statement st1 = connection.createStatement();
connection.close();
Statement st2 = connection.createStatement(); // error here ???


Generated at Thu Feb 08 03:12:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.