473,594 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

calling a method of the interface which was not implemented in any class

hi everybody,

Iam a java programmer actually i want to know how the Connection
object is created through DriverManager.g etConnection when
DriverManager class is not implements Connection interface and no class
in java implementas interface connection so how can we get a object
reference for connection object and call a getconnection method through
the connection object. i seen that there are lots of interface in java
which are not implemented on java but we take a reference of thet
interface and we call a method of that interface. how it is possible
coz interface have simple method declaration implementation in the
class which implement this inteface. so plz help me for this problem.
aim waiting for somebodies replay.
thanks
Choubey

Jul 17 '05 #1
2 4660
Choubey wrote:
hi everybody,

Iam a java programmer actually i want to know how the Connection
object is created through DriverManager.g etConnection when
DriverManager class is not implements Connection interface and no class
in java implementas interface connection so how can we get a object
reference for connection object and call a getconnection method through
the connection object. i seen that there are lots of interface in java
which are not implemented on java but we take a reference of thet
interface and we call a method of that interface. how it is possible
coz interface have simple method declaration implementation in the
class which implement this inteface. so plz help me for this problem.
aim waiting for somebodies replay.


The implementations for java.sql.Connec tion, java.sql.Statem ent,
java.sql.Result Set, etc. are usually provided by the JDBC driver. A
JDBC driver is usually provided by the database vendor, or sometimes via
third parties.

The philosophy behind this mechanism is that by providing interfaces,
the application programmer (you) can write code that uses the interfaces
only. Then you can load whichever JDBC driver you want at run-time,
without changing your code.

HTH,
Ray

--
XML is the programmer's duct tape.
Jul 17 '05 #2
hi ray

thank you for your reply.
bye
Dharmendra

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5136
by: Martin Maney | last post by:
I've been to the cookbook (both forms, since they're sometimes usefully different), but that gave rise to more questions than answers. Heck, let me pull some of them up while I'm at it. Martelli gives the recipie (5.3 on paper) "Calling a Superclass __init__ Method if it Exists" where he seems to say that this: class NewStyleOnly(A, B, C): def __init__(self): super(NewStyleOnly, self).__init__()
17
6632
by: Medi Montaseri | last post by:
Hi, Given a collection of similar but not exact entities (or products) Toyota, Ford, Buick, etc; I am contemplating using the Abstraction pattern to provide a common interface to these products. So I shall have an Abstract Base called 'Car' implemented by Toyota, Ford, and Buick. Further I'd like to enable to client to say Car *factory;
3
1727
by: Jarmo Muukka | last post by:
Hello, I have an interface which has a method which returns an interface. I would like to return a real type in implemented class. interface IFoo { .... }
7
2777
by: Christopher Wells | last post by:
There's something I don't understand about how the CollectionBase class is defined. I can declare: class Derived : CollectionBase { } I can instantiate this Derived class: Derived derived = new Derived();
5
2433
by: Keith Patrick | last post by:
Could someone tell me if it's possible (and if so, how) to call an explicitly-implemented interface method from a subclass? I have a class in which I have to explicity implement some methods, but my subclasses, which should use them, cannot call them. I'm not sure if it just isn't possible due to visibility or if I just don't have the syntax right. I can't make the methods protected, as the compiler complains (although the documentation...
1
2694
by: Dominic via DotNetMonster.com | last post by:
I am a CA-OpenROAD programmer, but I attempting to build some VB.NET DLLs and access them through OpenROAD as an external Windows TypeLib. I have managed to build a simple DLL (code follows) but the only method that I can see exposed is "DisplayNumber" which is a sub declared in a public interface definition rather than "DisplayNumbers" which is the name of the public sub based on the interface definition. My problem is when I attempt...
2
6104
by: Kevin Frey | last post by:
In a derived class I am trying to redefine the implementation of a interface method defined in a base class - the base class interface method was not declared virtual. I have yet to actually test this approach, but it looks ugly. Is there any better way? public interface ITest { void Func();
7
2672
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file name based on the name of the VB6 application. A second choice would be a file name based on the # COM interface assembly. I have tried calling Assembly.GetCallingAssembly() but this fails when I use the VB6 client. Is there a way to get this...
6
11565
by: Ole Nielsby | last post by:
VC has a __cdecl specifier which allows functions and methods to be called with varying parameter count. (I understand this is the default for functions in general but in VC, instances use another convention unless they have an ellipsis argument.) I can force GCC and other compilers to use such a convention by declaring all methods with an ellipsis, but I'd rather not clutter my method definitions with these.
0
7947
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7880
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
6665
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3868
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.