Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #1231

Re: Can a ResultSet be passed back to a main program

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.help
Subject Re: Can a ResultSet be passed back to a main program
Date Mon, 10 Oct 2011 14:26:23 -0700 (PDT)
Organization http://groups.google.com
Lines 30
Message-ID <21113601.1150.1318281983930.JavaMail.geo-discussion-forums@prmr13> (permalink)
References <4e92594f$0$14660$9a566e8b@news.aliant.net> <j6uvcp$uh2$2@dont-email.me> <4e932629$0$13642$9a566e8b@news.aliant.net> <27859861.989.1318266650875.JavaMail.geo-discussion-forums@prmr13> <4e93464e$0$13642$9a566e8b@news.aliant.net>
Reply-To comp.lang.java.help@googlegroups.com
NNTP-Posting-Host 2620:0:1000:fd42:224:d7ff:fe69:5838
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1318282089 4416 127.0.0.1 (10 Oct 2011 21:28:09 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Mon, 10 Oct 2011 21:28:09 +0000 (UTC)
In-Reply-To <4e93464e$0$13642$9a566e8b@news.aliant.net>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=2620:0:1000:fd42:224:d7ff:fe69:5838; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
User-Agent G2/1.0
X-Google-Web-Client true
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.help:1231

Show key headers only | View raw


Linus Flustillbe wrote:
> Lew wrote:
>> Linus Flustillbe wrote:
>>> import java.sql.*;
>>> 
>>> import mainClasses.*;
>>> public class connectionTest  {
>>>   public static void main(String[] args) 
>>>     throws ClassNotFoundException, SQLException
>>>   {
>>>     Class.forName("oracle.jdbc.driver.OracleDriver");
>>
>> Don't call 'forName()' more than once per application run.  Once the class is loaded, it's loaded.  Reloading it doesn't help and the method call spins cycles to no avail.
> 
> Hi Lew, I have to admit I'm not quite sure why that statement is there.
> I'll have to read up on it.  I took the bulk fo the class from another
> sample I found online and modified it.  Don't explain what it does, I'll
> figure it out... gotta learn on my own... I'm sure the tutorials have
> something or JLS.

Use the Javadocs, of course.  That's what they're for.  Any time you have to look up a method or type in the API, use the Javadocs as your first recourse.
<http://download.oracle.com/javase/7/docs/api/java/lang/Class.html#forName(java.lang.String)>

Whoever wrote the "sample" you found online must have their head screwed on wrong.  That's the trouble when you copy-and-paste without understanding what you're taking.  You might, as here, grab some bad code and not even know it.

Also, don't reject explanations.  That's not an optimal strategy for learning.  Don't be macho.

-- 
Lew

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Can a ResultSet be passed back to a main program Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-10 02:32 +0000
  Re: Can a ResultSet be passed back to a main program Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-10 02:37 +0000
  Re: Can a ResultSet be passed back to a main program Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-10 06:28 +0000
    Re: Can a ResultSet be passed back to a main program Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-10-10 14:26 -0300
      Re: Can a ResultSet be passed back to a main program Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-10 19:21 +0000
  Re: Can a ResultSet be passed back to a main program markspace <-@.> - 2011-10-10 07:27 -0700
    Re: Can a ResultSet be passed back to a main program Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-10 17:06 +0000
      Re: Can a ResultSet be passed back to a main program Lew <lewbloch@gmail.com> - 2011-10-10 10:10 -0700
        Re: Can a ResultSet be passed back to a main program Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-10 19:23 +0000
          Re: Can a ResultSet be passed back to a main program Lew <lewbloch@gmail.com> - 2011-10-10 14:26 -0700
            Re: Can a ResultSet be passed back to a main program Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-11 00:43 +0000
  Re: Can a ResultSet be passed back to a main program Roedy Green <see_website@mindprod.com.invalid> - 2011-10-12 09:52 -0700
    Re: Can a ResultSet be passed back to a main program Lew <lewbloch@gmail.com> - 2011-10-12 10:28 -0700
      Re: Can a ResultSet be passed back to a main program Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-13 01:24 +0000
        Re: Can a ResultSet be passed back to a main program Lew <lewbloch@gmail.com> - 2011-10-12 18:55 -0700

csiph-web