In my application I want to use the Interface Array and the method getResultSet(long index, int count).
My code is given below:
int count = 0;
long index = 3;
Connection connection = null;
ResultSet resultSet = null;
ResultSet resultSet1 = null;
Statement statement = null;
Array array = null;
connection = DriverManager.getConnection("jdbc
statement = connection.createStatement();
resultSet = statement.executeQuery("select count(*) from tblname");
count = resultSet.getInt(1);
System.out.println("Count is: " + count);
resultSet = statement.executeQuery("select * from tblname");
resultSet = array.getResultSet(index, count);
System.out.println("Column Value is: " + resultSet.getString("COLUMNNAME"));
my code is failing with a java.lang.NullPointerExceptuion at the line resultSet = array.getResultSet(index, count);
I think I need to map the ResultSet to the Array before extracting the value from it. How can I make the resultSet map to the array and get the value from the array?
Thanks in advance.