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

From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.help
Subject Re: Can a ResultSet be passed back to a main program
Date 2011-10-10 14:26 -0700
Organization http://groups.google.com
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>

Show all headers | 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


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