rushtosiva
Programmer
Hi All
Here is a part of the java code. There are 2 tables: emp and depts
emp : empno, enpname, deptno
depts: deptno, deptname
I'm using oracle8i. I wrote an sql query where by the output would be the employee number and the department name. When I ran the sql query in sqlplus, I'm getting the expected result. But when the same query is embedded in the java, the resultset does not produce any output.
try{
DriverManager.registerDriver
(new oracle.jdbc.driver.OracleDriver());
System.err.print("Establishing Connection..."
Connection conn = DriverManager.getConnection
("jdbcracleci8test","system","manager"
System.err.println("Done"
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select name,deptname from emp,depts where emp.deptno=depts.deptno"
while (rset.next()){
System.err.println(rset.getString(1));
System.err.println("and " + rset.getString(2));
}
I'm unclear about this problem.
Any suggestion / recommendation is recommended.
Thanks in Advance
Siva
Here is a part of the java code. There are 2 tables: emp and depts
emp : empno, enpname, deptno
depts: deptno, deptname
I'm using oracle8i. I wrote an sql query where by the output would be the employee number and the department name. When I ran the sql query in sqlplus, I'm getting the expected result. But when the same query is embedded in the java, the resultset does not produce any output.
try{
DriverManager.registerDriver
(new oracle.jdbc.driver.OracleDriver());
System.err.print("Establishing Connection..."
Connection conn = DriverManager.getConnection
("jdbcracleci8test","system","manager"
System.err.println("Done"
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select name,deptname from emp,depts where emp.deptno=depts.deptno"
while (rset.next()){
System.err.println(rset.getString(1));
System.err.println("and " + rset.getString(2));
}
I'm unclear about this problem.
Any suggestion / recommendation is recommended.
Thanks in Advance
Siva