ResultSet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vinny_Jack
Posted On:   Wednesday, June 6, 2001 08:08 AM

Able to fetch only one row in the ResulSet , whereas if I run the same query directly from SQL*Plus i am able to fetch more rows Can anybody tell me why Thanx The code goes below.. try { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); objConn = DriverManager.getConnection("jdbc:oracle:thin:@myhost:1521:ORCL", "scott", "tiger"); objStmt = objConn.createStatement(); strQuery = "SELECT e.ename AS ename, e.empid AS eid, t1.some_date AS sdate, " strQuery = strQuery + "t1.id AS tid, t2.status AS t2status, t2.remarks AS t2remarks" strQuery = strQuery + " FR   More>>

Able to fetch only one row in the ResulSet , whereas if I run the same query directly from SQL*Plus i am able to fetch more rows
Can anybody tell me why

Thanx

The code goes below..


try

{

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

objConn = DriverManager.getConnection("jdbc:oracle:thin:@myhost:1521:ORCL", "scott", "tiger");

objStmt = objConn.createStatement();

strQuery = "SELECT e.ename AS ename, e.empid AS eid, t1.some_date AS sdate, "

strQuery = strQuery + "t1.id AS tid, t2.status AS t2status, t2.remarks AS t2remarks"

strQuery = strQuery + " FROM emp e, type1 t1, type2 t2, type3 t3 "

strQuery = strQuery + " WHERE t1.pid = t2.fid AND t3.pid = t1.fid AND e.empid = t3.fid"

rsObj = objStmt.executeQuery(strQuery);

while(rsObj.next())

{

outPut = " "+rsObj.getObject("ename").toString()+" "+rsObj.getObject("tid").toString()+" "+rsObj.getObject("sdate").toString()+" "+rsObj.getObject("t2status").toString()+" ";

}

objStmt.close();

}

catch(SQLException e)

{

outPut = e.getMessage() ;

}

   <<Less

Re: ResultSet

Posted By:   Anonymous  
Posted On:   Wednesday, June 6, 2001 08:37 AM

Please don't post the same question twice.

Here is an answer: http://www.jguru.com/forums/view.jsp?EID=434556.

Regards
About | Sitemap | Contact