摘要:
c := make(chan int) // Allocate a channel.// Start the sort in a goroutine; when it completes, signal on the channel.go func() { list.Sort() c <- 1 // Send a signal; value does not matter.}()doSomethingForAWhile()<-c // Wait for sort to finish; discard sent value.Receivers always block unt... 阅读全文
摘要:
转自 http://ndebyq.blog.51cto.com/274018/93046java.sql.SQLException: Before start of result set解决方法:使用rs.getString();前一定要加上rs.next();原因:ResultSet对象代表SQL语句执行的结果集,维护指向其当前数据行的光标。每调用一次next()方法,光标向下移动一行。最初它位于第一行之前,因此第一次调用next()应把光标置于第一行上,使它成为当前行。随着每次调用next()将导致光标向下移动一行。在ResultSe对象及其t父辈Statement对象关闭之前,光标一直保 阅读全文