This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
While writing database programs we use interfaces such as Connection, Statement etc. But our class does not implement these interfaces. Why is it so??? For example: class xyz { Connection con = DriverManger.getConnection(); Statement stmt = con.createStatement() ..... } Here our class does not implement Connection as well as Statement interfaces
It will be very helpfull if someone gives us the reasons. Thanks in advance.
Raj Chila
Ranch Hand
Joined: Mar 18, 2004
Posts: 125
posted
0
I see is that, you dont implement the sql interfaces is that you get a Default Implementation from the Vendor who owns the Database to which you are coding for, or the Default implementation if using ODBC Data Sources.
Simply because there is not standard as to how a Database Application provides a non SQL interface to other Systems / Languages...so sun has atleast Standardized the interface that a java Programmer has to program to, to access the Database so that your code remains Database independent.
you could still implement the connection Class, but then that would mean you will be implementing the whole set of interfaces as all the interfaces are hirarchically linked...(that is, you get a Statement Object from a connection Object, a ResultSet Object from a Statement etc). You should be knowing The database you are intending to write the driver inside out, because it also involves calling native methods on the Database Side.
Hope this is attempting to answer your point.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.