dcsimg
15 Columns Can`t BUT 4 Can ...
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Harphajan_Singh
Posted On:   Monday, August 5, 2002 12:46 AM

Hi there ! I get java.lang.NullPointerException when I query more than 4 columns of a table. It doesn`t work for 15 columns , which I store in a vector . Here is my code :- while (outerRset.next()) { System.out.println("I`m in OuterRset"); System.out.println(outerRset.getString(2) ); String[] columnsLot = new String[15]; columnsLot[0] = outerRset.getString(1); columnsLot[1] = outerRset.getString(2); columnsLot[2] = outerRset.getString(3); columnsLot[3] = outerRset.getString(4); columnsLot[4] = innerRset.getString(5); columnsLot[5] = innerRset.getString(6); columnsLot[6] = innerRset.getString(7);    More>>

Hi there !

I get java.lang.NullPointerException when I
query more than 4 columns of a table.
It doesn`t work for 15 columns , which I store in a vector . Here is my code :-


			
while (outerRset.next())
{
System.out.println("I`m in OuterRset");
System.out.println(outerRset.getString(2) );
String[] columnsLot = new String[15];
columnsLot[0] = outerRset.getString(1);
columnsLot[1] = outerRset.getString(2);
columnsLot[2] = outerRset.getString(3);
columnsLot[3] = outerRset.getString(4);
columnsLot[4] = innerRset.getString(5);
columnsLot[5] = innerRset.getString(6);
columnsLot[6] = innerRset.getString(7);
columnsLot[7] = innerRset.getString(8);
columnsLot[8] = innerRset.getString(9);
columnsLot[9] = innerRset.getString(10);
columnsLot[10] = innerRset.getString(11);
columnsLot[11] = innerRset.getString(12);
columnsLot[12] = innerRset.getString(13);
columnsLot[13] = innerRset.getString(14);
columnsLot[14] = innerRset.getString(15);

vector.add(columnsLot);
// a Vector object... Let's print them out.
Enumeration enum1 = vector.elements();
while (enum1.hasMoreElements())
{
System.out.println("Printing Vector Results");
String[] columns1 = (String[]) enum1.nextElement();
out.println(columns1[0] + columns1[1] + columns1[2] + columns1[3] +columns1[4] + columns1[5] + columns1[6] + columns1[7] + columns1[8] + columns1[9] + columns1[10] + columns1[11] +columns1[12] + columns1[13] + columns1[14] +"

");
//out.println("hacks");
}
System.out.println("out of hacks");
   <<Less

Re: 15 Columns Can`t BUT 4 Can ...

Posted By:   Ivo_Limmen  
Posted On:   Monday, August 5, 2002 12:57 AM

In your code you switch from 'outerSet' to 'innerSet'. 'innerSet' is probably not used, or wrong.
About | Sitemap | Contact