tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asim Ghaffar" <u970...@giki.edu.pk>
Subject database access problem
Date Sun, 08 Apr 2001 17:49:03 GMT
Hello Friends!
I am in real difficult situation so i need some quick advice. I am making a
search engine. I did all my testing on MS Acess. So far so good. But now
when i switched to Oracle and SQL Server i am getting a very odd problem
(same in oravle and SQL).
here is my code.

1 try    {
2     ResultSet results = g.executeQuery(); //
3     while (results.next()) {
4         String u = results.getString("u");
5         String t = results.getString("T");
6         String s = (new Integer(results.getInt("S"))).toString();
7         String k = results.getString("K");            // Exception is
thrown here at this line
8         String a = results.getString("P");
9         String d = results.getString("D");
10       String m = (new Integer(results.getInt("I"))).toString();
11       String l = results.getString("L");
12       String o = (new Integer(results.getInt("O"))).toString();
13       String st = results.getTimestamp("St").toString();
14    }
15 }catch (SQLException sqle){
    sqle.printStackTrace();
 }

where g = connection.prepareStatement("INSERT INTO HITLIST SELECT SITES.*,1
AS SCORE FROM SITES WHERE SITES.PAGETEXT LIKE '%pakistan%'");


Now on line # 7 i am getting the exception
in SQL Server it is  [Microsoft][ODBC SQL Server Driver]Invalid Descriptor
Index
in Oracle it is some jdbc exeption about invalid column number

Now if i switch the wors with each other error again come on same line
number not statement.
I debugged using jbuilder and in the middle of execution all
resultset.getDataType("columnName") become inavlid even those which are on
lines above. So badically whole result set gets corrupted.
Same code is running fine in MS Access. Any clue what can be the reason for
this. Where else i can get help from.
thanking you in advance. I u have any clue do email me.
bye



Mime
View raw message