How to override an abstract method returning an interface type

E

etantonio

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
 
M

Matt Humphrey

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...

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 (e-mail address removed) http://www.iviz.com/
 
V

vahan

I'm agree with Matt, you have to write in your subclass:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top