We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sql sql = Sqls.create ( "SHOW TABLES" ); sql.setCallback ( new SqlCallback () {
@Override public Object invoke ( Connection conn , ResultSet rs , Sql sql ) throws SQLException { System.out.println ( rs );rs = null return rs; } } ); dao.execute ( sql );
不知道问题出在哪里,用原生的就没有任何问题 PreparedStatement ps = conn.prepareStatement ( sql.toPreparedStatement () ); rs = ps.executeQuery ();
while ( rs.next () ) { System.out.println ( rs.getObject ( 1 ) ); }
The text was updated successfully, but these errors were encountered:
只有select语句有ResultSet
Sorry, something went wrong.
因为查询的语句是SHOW TABLES,但是ResultSet死活是null,最后只能用原生来 PreparedStatement ps = conn.prepareStatement ( sql.toPreparedStatement () ); ResultSet rs = ps.executeQuery ();
while ( rs.next () ) { System.out.println ( rs.getObject ( 1 ) ); } 这样才能获取返回值, dao的自定义sql应该是把所有的sql执行并且把反馈值返回来,或者至少返回一个ResultSet
.... 怎样加个开关呢? 还是不支持?
如果拿不准,不如现在doc上面注明一下,我也感觉不是什么大问题,只是不知道的人会郁闷那么一会
06d1354
No branches or pull requests
Sql sql = Sqls.create ( "SHOW TABLES" );
sql.setCallback ( new SqlCallback ()
{
不知道问题出在哪里,用原生的就没有任何问题
PreparedStatement ps = conn.prepareStatement ( sql.toPreparedStatement () );
rs = ps.executeQuery ();
The text was updated successfully, but these errors were encountered: