• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Statement is an interface?

 
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to know that who does the implementation of this interface and how does it return the statement for executing the query form the connection object?
How does the database recognize that the call is for Simple/Prepared/Callable Statement?
 
thomas davis
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Have a look at the "Factory" pattern. It can have a series of interfaces that define specific behaviors, with the implementations provided by a factory class.
In this case the object handle is declared using the type of interface needed. The instance is received from the Connection class via one of its methods: createStatement(), prepareCall() or prepareStatement(). Considering the tight coupling between a Statement object and the associated Connection object, this makes a lot of sense.
The Statement interface provides access to the base behavior, and is extended by the PreparedStatement, which is further extended by the CallableStatement.
[ July 07, 2003: Message edited by: Philip Shanks ]


T
 
thomas davis
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Have a look at the "Factory" pattern. It can have a series of interfaces that define specific behaviors, with the implementations provided by a factory class.
In this case the object handle is declared using the type of interface needed. The instance is received from the Connection class via one of its methods: createStatement(), prepareCall() or prepareStatement(). Considering the tight coupling between a Statement object and the associated Connection object, this makes a lot of sense.
The Statement interface provides access to the base behavior, and is extended by the PreparedStatement, which is further extended by the CallableStatement.
[ July 07, 2003: Message edited by: Philip Shanks ]


When I have gone through your answer, I got a question as given below:
What is "Factory" pattern?
What are the Factory classes?
Where can I find these classes and Factory Pattern?
Do you have any documentation for this ,if you have any documentation or article on this please send it to me.
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey man, just "Google" for it!
Here is what I found.
 
Get me the mayor's office! I need to tell her about this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic