GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Certification  >  Sun
Go To First  |  Previous Question  |  Next Question 
 Sun  |  Question 37 of 38    Print  
Can we use Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") inside non static function?

  
Total Answers and Comments: 1 Last Update: March 30, 2007     Asked by: umesh 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
September 11, 2007 02:04:30   #1  
gptnitesh Member Since: September 2007   Contribution: 11    

RE: can we use Class.forName("sun.jdbc.odbc.JdbcOdbcDr...

Ofcourse why not, you can use Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
inside non static function.  But I will suggest you should use this inside
static block. The reason is we put this in the static block is that we only have
to load the driver once.


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : String are made immutable because 1. better memory management.Generally thousands of string literals objects are created in any of the application.To avoid the individual memory allocation to all the string objects ,JVM creates the string literal objects ...
Read Answers (6) | Asked by : Ram kishor Meena

Latest Answer : ) Abstract class defines few or none of the methods, but interface defines all the methods..2) Abstract classes should have subclasses else that will be useless..Interfaces must have implementations by other classes else that will be useless3)only an ...
Read Answers (19) | Asked by : apt_dpl
Tags : Abstract

Latest Answer : Class loaders are one of the cornerstones of the Java virtual machine (JVM) architecture. They enable the JVM to load classes without knowing anything about the underlying file system semantics, and they allow applications to dynamically load Java classes ...

Latest Answer : According to the Java Specification, the  four methods related to threading is defined in the Object class rather than the Thread Class, because of the Java Concurrency and Synchronised construct. As we start the JDK, there are different therad runs ...

Servlet is Java class. Then why there is no constructor in Servlet? Can we write the constructor in Servlet
Read Answers (11) | Asked by : Suresh

Latest Answer : it is used to load the class at runtime and in jdbc it is used to load the driver and according to specification every driver class must contain a static block in which it contains the code to instanciate itself and the register itself with the driver ...
Read Answers (5) | Asked by : saipadma

What will happen when u attempt to compile and run the below code. int a = (int) Math.random(); a.0 b.1 c. compilation fails d. 0 to Ineteger.MAX_VALUE 3. which two are used to declare the boolean primitive a. boolean b =0;b. boolean b = Boolean.TRUE;c. boolean b = true;d. boolean b = (3>=0); 4. what is the O/P? class A{ Void get(){ Sysout(“A”);}} Class B extends A{ Void get(){

Why the clone method in object is defined as protected one.Since every class is a subclass of object what is the significance of the protected access modifier
View Question | Asked by : Raj vardhan Reddy

Latest Answer : Ofcourse why not, you can use Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") inside non static function.  But I will suggest you should use this inside static block. The reason is we put this in the static block is that we only have to load ...
Read Answers (1) | Asked by : umesh


 Sponsored Links

 
Related Articles

Performing XSLT Transformations inside the Database

Performing XSLT Transformations inside the Database Now that you have the employees XSL stylesheet stored in the database and the xmlusr schema is permitted to access the hr employees table you can create a script that will instruct the database to build an HTML page based on the data stored in hr e
 

Performing XML Processing inside the Database

Performing XML Processing inside the Database When building XML enabled applications on top of Oracle there are many advantages to performing the XML processing inside the database when compared to performing it on the client The key advantages to perform XML processing inside the database are as fo
 

SOA Definitions and Certification

SOA Definitions and Certification Service Oriented Architecture is a design that enables Business and computational resources to be linked together on demand as a means of achieving the results desired for service consumers which may be end users or other services Service Oriented Architecture has
 

C++ Static Functions

C Static Functions Static member functions have a class scope and they do not have access to the this pointer of the class When a member is declared as static a static member of class it has only one data for the entire class even though there are many objects created for the class The main usage of
 

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

C++ Function Passing Types

C Function Passing Types In this C tutorial you will learn about function passing types two types of arguments passing in functions passed by value  and  passed by reference are discussed here mosgoogle center The arguments passed to a function can be performed in two ways Passed
 

How to Access C++ Class Members

How to Access C Class Members In this C tutorial you will learn how to access Class members dot operator or class member access operator difference between struct and class and  scope resolution operator mosgoogle center It is possible to access the class members after a class is defined an
 

What is DECODE function used for?

DECODE is used to decode a CHAR or VARCHAR2 or NUMBER into any of several different character strings or numbers based on value. That is DECODE does a value-by-value substitution. For every value that is given in the DECODE function it makes an if then check and matches the value. The general format
 

printf() Function Return Value

What is the return value from printf() function? printf function always returns the number of characters printed. Let us understand this with an example: main() { int a=10; printf("%d",printf("%d %d %d", a,a,a)); } In this above program the inner printf i
 

How is the main() function declared?

The declaration of main can be done as int main() One more declaration that can be taken by main is command line arguments form int main(int argc, char *argv[]) or this can also be written as int main(argc, argv) int argc; char *argv[]; NOTE: It is not possible for one to declare the main
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape