Originally reported at http://www.cubrid.org/412708.
If you try the code below, it will display no results, even though the demodb database used for the below example has entries that have the event Handball or Rowing.
{code:java}
import java.sql.*;
import cubrid.jdbc.driver.*;
public class Tester {
public static void main(String args[]) {
try {
Class.forName(cubrid.jdbc.driver.CUBRIDDriver);
CUBRIDConnection cn = (CUBRIDConnection) DriverManager.getConnection(jdbc:cubrid:localhost:30000:demodb:dba::);
cn.setCharset(UTF-8);
CUBRIDPreparedStatement stm = (CUBRIDPreparedStatement)(cn.prepareStatement(Select code, gender, nation_code from athlete where event in ?));
String[] p = {Handball};
stm.setCollection(1, p);
ResultSet rs = stm.executeQuery();
while(rs.next()) {
System.out.println(rs.getInt(code));
}
System.out.println(done);
} catch(Exception err) {
err.printStackTrace();
}
}
}
{code}
Just run this code after you have installed CUBRID with the demodb database. It should display the code for each athlete that participated in the Rowing or Handball event.
Instead it displays no results (just the done message).