db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BalNagendra <balnagen...@gmail.com>
Subject Re: Tree view in Derby Stored Procedure
Date Sat, 18 Apr 2015 10:44:51 GMT
It is all garblled. I am reposting the code:

1 package recursion;
2 import java.sql.*;
3 public class RecursiveSQL {
4	public static EmpRecord databaseConnection () throws SQLException {
5        Connection c = null;
6		Statement s = null;
7		ResultSet rs = null;
8		String ename = null;
9		EmpRecord emp = new EmpRecord();
10		try {
11			c = DriverManager.getConnection("jdbc:derby:scott");
12			s = c.createStatement();
13			rs = s.executeQuery("SELECT empno, ename FROM EMP");
14			rs.next();
15			System.out.println("rs="+rs.getString("ename"));
16			emp.empno = rs.getInt("empno");
17			emp.ename = rs.getString("ename");
18			c.close();
19		} 
20		catch (SQLException sx) {
21			System.out.println ("
Database Connect SQL Exception.
");
22			sx.printStackTrace();
23		}
24		return (emp);
25	}         
26}



--
View this message in context: http://apache-database.10148.n7.nabble.com/Tree-view-in-Derby-Stored-Procedure-tp143909p143951.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Mime
View raw message