Stored procedure and JDBC

Bob Kline bkline at rksystems.com
Tue Apr 4 10:34:05 EDT 2000


On Tue, 4 Apr 2000, Emmanuel Blot wrote:

> Hello,
> 
> I am looking for hours to get FreeTDS to work with SQL server 7.0
> stored procedure.

Here's an example of a call to a stored procedure which takes one input
parameter and produces a result set with two columns (INT and VARCHAR):

    Connection c = DriverManager.getConnection(url, uid, pwd);
    Statement s  = c.createStatement();
    ResultSet rs = Stmt.executeQuery("exec sp_t 50");
    while (rs.next())
        System.out.println(rs.getInt(1) + ", " + rs.getString(2));

Hope this helps.

-- 
Bob Kline
mailto:bkline at rksystems.com
http://www.rksystems.com





More information about the FreeTDS mailing list