🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #1095

help - resultset

#1095
From: Prescott Pym
Date: Wed, 14 Jul 1999 00:00
26 lines
1419 bytes
hello

I'm having a bit of trouble..I have a resultset that I wish to return to
another function, but it is created within a try { } block, thus the return
statement cannot return it...here is the code

ResultSet callDatabase ()
{
    ResultSet rs;
    try
    {
        String url = "jdbc:odbc:HighVoltage";
        String query = "SELECT * FROM CURRENCIES";
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection con = DriverManager.getConnection(url,"","");
        Statement stmt = con.createStatement();
        rs = stmt.executeQuery(query);
    }
    ......
    return rs;
}

how can I get around this (I'm just a beginner to database coding).

thanks
Prescott
Technical Details
Message-ID: <378c5de5@dvs1.aus.to>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d6db,95c997fcc95fe86c,start
X-Google-Attributes: gid10d6db,public
From: "Prescott Pym" <ppym@bigpond.net.au>
Subject: help - resultset
Date: 1999/07/14
Message-ID: <378c5de5@dvs1.aus.to>
X-Deja-AN: 500869017
X-Original-NNTP-Posting-Host: cpe-24-192-21-44.vic.bigpond.net.au
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
X-Complaints-To: abuse@telstra.net
X-Trace: nsw.nnrp.telstra.net 931945961 24.192.24.62 (Wed, 14 Jul 1999 19:52:41 EST)
Organization: Anarchadia (news://dvs1.aus.to), where freedom rules with an iron fist.
XPident: nobody
NNTP-Posting-Date: Wed, 14 Jul 1999 19:52:41 EST
Newsgroups: aus.computers.java