Quantcast
Channel: MySQL Forums - Connector/J, JDBC and Java
Viewing all articles
Browse latest Browse all 884

statement.setMaxRows() doesn't work when calling a stored procedure (2 replies)

$
0
0
It seems that Statement doesn't honor setMaxSize() when doing calls to stored procedures. Is this a bug or a feature? Or am I mistaken?

The code below gives more than 2 rows (if any_proc() returns more).

I'm using 5.1.21 connector/j (latest?)

Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/db", "root", "root");
Statement statement = connection.createStatement();
statement.setMaxRows(2);
ResultSet resultSet = statement.executeQuery("call any_proc()");
while (resultSet.next()) {
System.out.println("got one");
}
connection.close();

Viewing all articles
Browse latest Browse all 884

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>