Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

How to override an abstract method returning an interface type

Thread view: 
etantonio@gmail.com - 06 Jul 2006 13:35 GMT
Ciao,
I've this class that implements the interface PreparedStatement

public class SCTRDebuggableStatement implements PreparedStatement
{ .... }

but I've not implemented the abstract method ParameterMetaData so
defined in PreparedStatement

   ParameterMetaData getParameterMetaData() throws SQLException;

Also ParameterMetaData is an interface, all that I need is to compile a
very big project, I'm not interested to these classes but how can I
modify SCTRDebuggableStatement to finally see it compile without
errors...

many thanks if you can help me

Antonio D'Ottavio
www.etantonio.it/en
Matt Humphrey - 06 Jul 2006 15:33 GMT
> Ciao,
> I've this class that implements the interface PreparedStatement
[quoted text clipped - 11 lines]
> modify SCTRDebuggableStatement to finally see it compile without
> errors...

If all you're trying to do is to reach a compilable state, simply have the
method throw an exception that says "Not implemented".

throw new UnsupportedOperationException ("Not implemented.");

You don't have to declare this kind of exception.

Cheers,
Matt Humphrey matth@ivizNOSPAM.com  http://www.iviz.com/
vahan - 07 Jul 2006 05:44 GMT
I'm agree with Matt, you have to write in your subclass:

ParameterMetaData getParameterMetaData() throws SQLException {
    throw new UnsupportedOperationException ("Not implemented.");
}

> > Ciao,
> > I've this class that implements the interface PreparedStatement
[quoted text clipped - 21 lines]
> Cheers,
> Matt Humphrey matth@ivizNOSPAM.com  http://www.iviz.com/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.