Enum implementing Generic interface

Is there any way to implement a generic interface and specify the types for each enum
public interfact IPrimaryKeyType<C extends Object> {
public enum PrimaryKeyType implements IPrimaryKeyType {
SINGLE,
COMPOSITE,
There is no way to specify the type for each enum element. Though you can specify the type for all enums as below.
public enum PrimaryKeyType implements IPrimaryKeyType<Object> {
SINGLE,
COMPOSITE,
Any ideas?

The best way to answer questions like this is to look at the spec: http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.9
The answer seems to be that what you're trying to do is impossible.

Similar Messages

  • Implementing two generic interfaces

    I have a generic interface,
    public interface Callback<R> {
       void result(R r);
    }Now I want to implement two Callback interfaces, like this
    class X implements Callback<Type1>, Callback<Type2> {
       public void result(Type1 r) {};
       public void result(Type2 r) {};
    }But Eclipse tells me "The interface Callback cannot be implemented more than once with different arguments".
    I don't see the reason why really. The two overloaded result methods have different signatures so there shouldn't be any problem in resolving the correct one based on parameter type in principle.
    Does anybody know the reason for this restriction or is it maybe an issue with Eclipse. I'm using Eclipse 3.2M5a and Java 6.0 beta.

    mlk has the correct answer, but here's some more explanation:
    Generics are only used at compile time. The actual bytecode specifies the base object type (aka type erasure), in this case Object. When you implement a generified interface, the compiler will generate a bridge method from the erased type to the specific type.
    Some examples should make this clearer.
    First, your interface. If you run javap on the compiled class, you'll see that it only defines a single method, "void result(Object)".
    Code that invokes the interface, like this:
        Callback<String> foo = \\
        foo.result("bar");also gets translated to a call on the base type. As far as the compiled class is concerned, there is no type safety. However, the compiler will complain if you pass something other than a String.
    The implementation class is where things get interesting:
    public class TestCallback implements Callback<String> {
      public void result(String x) {
    }If you run javap on this class, you'll see that it contains two implementations of result(): one that takes a String, and one that takes an Object. If you look at the bytecode, the latter performs a cast on the Object and invokes the String variant.

  • Can Enum parameterized type implement an interface?

    I am trying to define a class that is parameterized with an Enum and the parameterized Enum must implement an interface. Here is some code:public interface MatchingEnum<E> {
        String match(); // This interface is not yet complete
    public class EnumField<E extends Enum<E> & MatchingEnum<E>> {
        private E enumeration;
        public EnumField(E enumeration) {
            this.enumeration = enumeration;
        private static class Test {
            EnumField<TestType> c;
        public enum TestType implements MatchingEnum<TestType> { One, Two, Three;
            public String match() {
                return null;
    }The problem is that the compiler complains that "classes cannot directly extend java.lang.Enum". If I delete the interface for the parameterized type(below) it compiles fine. Why can't the compiler handle this? Does specifying an Interface for an Enum bounds (E) force it to directly extend Enum? If so, why does the actual Enum compile?public class EnumField<E extends Enum<E>> {Blah, blah, blah... // This compiles
    public class EnumField<E extends Enum<E> & MatchingEnum<E>> {Blah, blah blah... // This does NOT compile

A: Can Enum parameterized type implement an interface?

Compiled from "EnumField.java"
public class com.dartcontainer.mdc.picaps.textui.screen.widget.EnumField extends java.lang.Object{
public com.dartcontainer.mdc.picaps.textui.screen.widget.EnumField(java.util.List);
  Code:
   0:   aload_0
   1:   invokespecial   #2; //Method java/lang/Object."<init>":()V
   4:   aload_0
   5:   aload_1
   6:   putfield        #1; //Field enumeration:Ljava/util/List;
   9:   return
public static void main(java.lang.String[]);
  Code:
   0:   new     #3; //class com/dartcontainer/mdc/picaps/textui/screen/widget/EnumField$Test
   3:   dup
   4:   aconst_null
   5:   invokespecial   #4; //Method com/dartcontainer/mdc/picaps/textui/screen/widget/EnumField$Test."<init>":(Lcom/dartcontainer/mdc/picaps/textui/screen/widget/EnumField$1;)V
   8:   astore_1
   9:   getstatic       #5; //Field java/lang/System.out:Ljava/io/PrintStream;
   12:  new     #6; //class java/lang/StringBuilder
   15:  dup
   16:  invokespecial   #7; //Method java/lang/StringBuilder."<init>":()V
   19:  ldc     #8; //String t.m =
   21:  invokevirtual   #9; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
   24:  aload_1
   25:  getfield        #10; //Field com/dartcontainer/mdc/picaps/textui/screen/widget/EnumField$Test.m:Ljava/lang/String;
   28:  invokevirtual   #9; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
   31:  invokevirtual   #11; //Method java/lang/StringBuilder.toString:()Ljava/lang/String;
   34:  invokevirtual   #12; //Method java/io/PrintStream.println:(Ljava/lang/String;)V
   37:  return
static java.util.List access$100(com.dartcontainer.mdc.picaps.textui.screen.widget.EnumField);
  Code:
   0:   aload_0
   1:   getfield        #1; //Field enumeration:Ljava/util/List;
   4:   areturn
}

Compiled from "EnumField.java"
public class com.dartcontainer.mdc.picaps.textui.screen.widget.EnumField extends java.lang.Object{
public com.dartcontainer.mdc.picaps.textui.screen.widget.EnumField(java.util.List);
  Code:
   0:   aload_0
   1:   invokespecial   #2; //Method java/lang/Object."<init>":()V
   4:   aload_0
   5:   aload_1
   6:   putfield        #1; //Field enumeration:Ljava/util/List;
   9:   return
public static void main(java.lang.String[]);
  Code:
   0:   new     #3; //class com/dartcontainer/mdc/picaps/textui/screen/widget/EnumField$Test
   3:   dup
   4:   aconst_null
   5:   invokespecial   #4; //Method com/dartcontainer/mdc/picaps/textui/screen/widget/EnumField$Test."<init>":(Lcom/dartcontainer/mdc/picaps/textui/screen/widget/EnumField$1;)V
   8:   astore_1
   9:   getstatic       #5; //Field java/lang/System.out:Ljava/io/PrintStream;
   12:  new     #6; //class java/lang/StringBuilder
   15:  dup
   16:  invokespecial   #7; //Method java/lang/StringBuilder."<init>":()V
   19:  ldc     #8; //String t.m =
   21:  invokevirtual   #9; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
   24:  aload_1
   25:  getfield        #10; //Field com/dartcontainer/mdc/picaps/textui/screen/widget/EnumField$Test.m:Ljava/lang/String;
   28:  invokevirtual   #9; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
   31:  invokevirtual   #11; //Method java/lang/StringBuilder.toString:()Ljava/lang/String;
   34:  invokevirtual   #12; //Method java/io/PrintStream.println:(Ljava/lang/String;)V
   37:  return
static java.util.List access$100(com.dartcontainer.mdc.picaps.textui.screen.widget.EnumField);
  Code:
   0:   aload_0
   1:   getfield        #1; //Field enumeration:Ljava/util/List;
   4:   areturn
}

  • Specialized vs. Generic Interfaces?

    Hi,
    I am new to these forums, please let me know if this is already part of a FAQ or not the appropriate place to ask this question.
    When designing an interface, would you recommend specialized or Generic Interfaces?
    As I am not sure if makes any sense, here are the two thinkings I have to define a myObject.getExportOptions() method that would return the ExportOptions that can be applied (i.e. "setCharacterDelimiter" for CSV export, "setHeader" for PDF, HTML....)
    Option 1:
    the code looks like:
      myObject.setExportMode(MICROSOFT_EXCEL);
      myExportOptions = (ExportOptionsExcel) myObject.getExportOptions();where the getExportOptions() would be defined as
    ExportOptions getExportOptions(); with the ExportOptions interface only defining all the common export options to all the export methods (PDF, Excel, HTML, Text...). And then to get to the export options that are specific to an export format, you would have to cast the object to a specific interface which extends the "generic" interface.
    Option 2:
    the code looks like:
      myObject.setExportMode(MICROSOFT_EXCEL);
      myExportOptions = myObject.getExportOptions();where the getExportOptions() would be defined as
    ExportOptions getExportOptions();with ExportOptions defining all the export options accross all the export methods (PDF, Excel, HTML, Text...). But if you tried to call the ".setExcelFormat(EXCEL_95)" method when the ExportMode is set to "TEXT_ONLY" then an exception would be raised (maybe something like "ExceptionNotApplicableToExportFormat").
    I did not find any document describing the prefered method of building this.... Any idea?
    Thanks,
    MonLand.

    I think I was not clear enough in my first message. Let me try to re-explain with a little bit more details (and more pseudo-code).
    Option 1:
    myReport.setExportMode(MICROSOFT_EXCEL);
    ExportOptions myExportOptions = myObject.getExportOptions();
    myExportOptions.setExportFileName("myReport"); // This would be common to any "export format" Now, for the "Excel" specific parameters, I would have to cast the options:
    ExportOptionsExcel myExcelExportOptions = (ExportOptionsExcel) myExportOptions;
    myExcelExportOptions.setExcelFileFormat(EXCEL_97);From the implementation point of view, I can have one "generic" ExportOption class/interface that contains all the common export properties. In addition, three or more classes that implement the specific export settings (one for Text_ONLY; one for MICROSOFT_EXCEL; one for PDF.....). From the developer point of view, to be able to set the "specific" properties, they have to know what interface to cast the export options to (because in the background, the reportObject class would create/return the "right" export options based on the export format that was set).
    Option 2:
    This time the ExportOptions is a much more generic interface and declares everything. But an exception is raised if I am trying to set parameters that don't make sense:
    myReport.setExportMode(MICROSOFT_EXCEL);
    ExportOptions myExportOptions = myObject.getExportOptions();
    myExportOptions.setExportFileName("myReport"); // This would be common to any "export format"
    myExportOptions.setExcelFileFormat(EXCEL_97);Now, if I was to do:
    myReport.setExportMode(TEXT_ONLY);
    ExportOptions myExportOptions = myObject.getExportOptions();
    myExportOptions.setExportFileName("myReport"); // This would be common to any "export format"
    myExportOptions.setExcelFileFormat(EXCEL_97);This last line would raise an exception (let's say "UnsupportedProperty") because the Text mode does not support the ExcelFileFormat property.
    From the implementation point of view, I can have three or more classes that implement the "ExportSettings" interface (one for Text_ONLY; one for MICROSOFT_EXCEL; one for PDF.....). But from the developer point of view, it does not matter with class gets used.
    Why I am asking: I am currently facing a design that looks like Option 1 and I can not figure out why this has to be that complex to use. Very hard to document if you replicate that design everywhere in a large API with a large number of objects/interfaces; you never know what to cast the object to; you never can guess what method you are looking for because you have to look at the definition of 3 or 4 interface at the minimum to see if you see something that fits your needs. So I am trying to understand if this is because it is much easier to implement that Option 2.
    I see the following drawback for Option 2: If you need to add an extra property to one of the export format, you probably have to update the "generic" interface, the "generic" implementation of that interface, and each "specific" implementation to reflect that new property.
    Thanks a lot for your time!
    MonLand

  • How to refer to genericized interface

    Hi,
    I have the following interface:
    package org.tbiq.gwt.tools.rpcrequest.server;
    import org.tbiq.gwt.tools.rpcrequest.browser.RpcRequest;
    import org.tbiq.gwt.tools.rpcrequest.browser.RpcRequestException;
    import org.tbiq.gwt.tools.rpcrequest.browser.RpcRequestService;
    import org.tbiq.gwt.tools.rpcrequest.browser.RpcResponse;
    public interface RpcRequestHandler<ReqT extends RpcRequest<ResT>, ResT extends RpcResponse>
    public boolean isCompatibleWith(Class<ReqT> rpcRequestClass);
    public ResT execute(ReqT rpcRequest)
    throws RpcRequestException;
    }I also have a dummy implementation of this interface:
    package org.tbiq.gwt.tools.rpcrequest.server;
    import org.tbiq.gwt.tools.rpcrequest.browser.DummyRpcRequest;
    import org.tbiq.gwt.tools.rpcrequest.browser.DummyRpcResponse;
    import org.tbiq.gwt.tools.rpcrequest.browser.RpcRequestException;
    public class NewDummyRequestHandler
    implements RpcRequestHandler<DummyRpcRequest, DummyRpcResponse>
    @Override
    public DummyRpcResponse execute(DummyRpcRequest rpcRequest)
    throws RpcRequestException
    // TODO Auto-generated method stub
    return null;
    @Override
    public boolean isCompatibleWith(Class<DummyRpcRequest> rpcRequestClass)
    if (DummyRpcRequest.class == rpcRequestClass)
    return true;
    return false;
    }This interface refers to 2 dummy objects DummyRpcRequest and DummyRpcResponse. There is nothing special about them. They are just regular beans that implement marker interfaces (RpcResponse and RpcRequest<T extends RpcResponse>).
    DummyRpcResponse:
    package org.tbiq.gwt.tools.rpcrequest.browser;
    @SuppressWarnings("serial")
    public class DummyRpcResponse
    implements RpcResponse
    }DummyRpcRequest:
    package org.tbiq.gwt.tools.rpcrequest.browser;
    @SuppressWarnings("serial")
    public class DummyRpcRequest
    implements RpcRequest<DummyRpcResponse>
    }Somewhere else, I have a class that implements some other interface. Part of implementing that interface is this method:
    @Override
    public <T extends RpcResponse> T execute(RpcRequest<T> rpcRequest)
    throws RpcRequestException
    RpcRequestHandler<??????> handler = new NewDummyRequestHandler();
    return handler.execute(rpcRequest);
    }So, the '?????' is my question. How do I refer to the handler such that it compiles. Right now, now matter what I try in that line, the handler.execute(rpcRequest) doesn't compile.
    Also, it's possible that I messed up my RpcRequestHandler interface and defined it in a wrong way (as far as generics are concerned). I am not sure.
    Any help would be much appreciated!
    Thanks,
    Yaakov.
    P.S. The code in the last method is obviously for testing only. I am planning to have a Map of those handlers and choose the handler dynamically based on the type of the RpcRequest that is passed into the execute method.
    Edited by: ychaikin on Feb 23, 2010 1:10 PM

    Had a play round some more with this to refresh my knowledge, and understand exactly where you're coming from
    I don't know what your RpcRequest and RpcResponse interfaces look like - although since your concrete implementations DummyRpcRequest and DummyRpcResponse don't implement any methods, I guess that means that the two interfaces are blank.
    The fact that the RpcRequest takes a parameter of a subclass of RpcResponse, though, implies that there's some sort of relationship there. Perhaps, in future, you intend to have a method sig in RpcRequest that say, returns a subclass of (the type of RpcResponse you created the concrete implementation of RpcRequest with). It's hard to offer more suggestions without knowing exactly what you intend with this code.
    A handler takes a RpcRequest<RpcResponse>, runs its execute method, and somehow (depending on implementation) returns an RpcResponse.
    So I tested some code which I guess summarises your situation, and which works okay - if you want, you can blat this all into a file Test.java and compile/run it in textpad.
    interface Response {
         String message();
    class SpecificResponse implements Response {
         public String message() { return "Why hello there!"; }
    interface Request<E extends Response> {}
    /* This Request subclass stores a canned, fixed Response object. */
    class StoredResponseRequest<E extends Response> implements Request<E> {
         private E myResponse;
         public StoredResponseRequest(E useThis) {
              myResponse = useThis;
          public E getStoredResponse() {
              return myResponse;
    /* A handler <B, A> is able to take in a B (extends Request<A>), and return an A. */
    interface Handler<B extends Request<A>, A extends Response> {
         public A execute(B request);
    /* A HandlerForStoredResponseRequests works by assuming that all the Request<A>s it gets passed are, in fact,
         StoredResponseRequest<A>s. It therefore extracts the necessary A from the object and returns it.  */
    class HandlerForStoredResponseRequests <B extends Request<A>, A extends Response> implements Handler<B, A> {
         public A execute(B sreq) {
              return ((StoredResponseRequest<A>)sreq).getStoredResponse();
    class Test {
         public static void main(String[] argz) {
              Request<Response> request = new StoredResponseRequest<Response>(new SpecificResponse());
              System.out.println( execute(request).message() );
         public static <T extends Request<E>, E extends Response> E execute(T request) {
              Handler<T, E> stuffHandler = new HandlerForStoredResponseRequests<T, E>();
              return stuffHandler.execute(request);
    }

  • Writing generic interfaces?

    I would like to write a generic interface for a Factory. The implemented Factory should as minimum contain two methods that returns a List of "something" as seen below.
    But I don't want to put any restrictions on the return type since a user might want to use objects from his or her own API. Is the solution to just specify the interface as:
    public interface IReportFactory {
         List newProducts();
         List newTables();
    }

    Here's a small example to guide you. Good luck my friend...
    import java.util.*;
    public class Test
         public static void main(String... args)
              List<Product> prodList = new ArrayList<Product>();
              prodList.add(new Product("radio", 100)); prodList.add(new Product("Walkman", 50));
              List<Table> tableList = new LinkedList<Table>();
              tableList.add(new Table("customer", 100)); tableList.add(new Table("Product", 1000));
              Report r = new Report(prodList, tableList);
              System.out.println("Products\n----------\n"+r.newProducts());
              System.out.println("Tables\n----------\n"+r.newTables());
              System.out.println("\nChanging Structures to Vector and Stack\n");
              prodList = new Vector<Product>();
              prodList.add(new Product("radio", 100)); prodList.add(new Product("Walkman", 50));
              tableList = new Stack<Table>();
              tableList.add(new Table("customer", 100)); tableList.add(new Table("Product", 1000));
              r = new Report(prodList, tableList);
              System.out.println("Products\n----------\n"+r.newProducts());
              System.out.println("Tables\n----------\n"+r.newTables());
    class Product
         String name; double price;
         Product(String n, int p){ name = n; price = p;}
         public String toString(){ return "\nName = "+name+" & Price = "+price+"\n";}
    class Table
         String name; int numRecs;
         Table(String i, int v){ name = i; numRecs = v;}
         public String toString(){ return "\nName = "+name+" & # of Records = "+numRecs+"\n";}
    class Report<T, V> implements IReportFactory<T, V>
         T prodList;
         V tableList;
         Report(T prodList, V tableList)
              this.prodList = prodList;
              this.tableList = tableList;
         public T newProducts()
              return this.prodList;
         public V newTables()
              return this.tableList;
    interface IReportFactory<T, V>
         T newProducts();
         V newTables();
    }

  • Generic interface methods

    The problem is that I want a generic interface that has a method that returns type T. And concrete implementations specify the type T and the method body.
    Given the interface and class below, why do I get an unchecked conversion warning, and how do I eliminate it? Or is there an alternative?
    Warning displayed by eclipse:
    Type safety: The return type String of the method convert(String) of type AsciiStringConverter needs unchecked conversion to conform to the return type T of inherited method.
    This code compiles...
    public interface StringConverter<T>
        public T convert(String string);
    public class CharacterValueConverter implements StringConverter<int[]>
        public int[] convert(String string) //unchecked conversion warning
            int[] values = new int[string.length()];
            for (int i = 0; i < string.length(); i++)
                values=(int)string.charAt(i);
    return values;
    Thanks,
    C.

    Here is the code that is used to test the CharacterValueConverter...
    public class Test
        public static void main(String[] args)
            int[] values = new CharacterValueConverter().convert("abc");
            for(int i : values)
                System.out.println(i);
    }

  • Why we require to implement Serializable interface?

    Hi techies,
    I am new to Serialization. Why we require to use Serializable interface for Serializing objects. Since Serializable interface is a marker interface, how it prevents objects not implementing Serializable from being Serialized. Does Java Compiler checks it or how it checks it?

    JavaBreather wrote:
    Since Serializable interface is a marker interface, how it prevents objects not implementing Serializable from being >Serialized. Does Java Compiler checks it or how it checks it?Compiler does nothing but mark the class as implementing the interface. You can then later check whether “objects instanceof Interface" and find out whether or not it is present. As said above, ObjectOutputStream does the same thing.
    Marker interfaces are a misuse of interfaces, and should be avoided. You shouldn't create new ones.Annotations introduce in Java 5 are a generic mechanism of adding metadata to a class.

  • How to implement XI interfaces in online and offline modes?

    Hi Everybody,
    Can you please tell me how to implement XI interfaces in online and offline modes?
    thanks a lot,
    Ramya Shenoy.

    Hi,
    Are you looking for Push and Pull mechanism of PI?
    When the adapters like SOAP, HTTP, IDOC, etc. send the data to PI , it is nothing but a push mechanism, and hence the communication is synchronous by default.
    But adapters like JDBC, File, etc. they fetch the data from Source Applications, so it is a kind of Pull mechanism for PI, and
    by default communication is asynchrnous.
    Pls elaborate exactly what are you looking for?
    Regards,
    Supriya.

  • Actual implementation of interfaces involved in JDBC connection creation

    Pl some body tell me where does the actual implementation of interfaces like connection,Statement,PreparedStatement..we use to to make a JDBC connection from a simple application or J2EE application.
    Thanks

    Hi sharma,
    JDBC API will be implemented by JDBC Driver vendors. For example Microsoft provide "com.microsoft.jdbc.sqlserver.SQLServerDriver" driver for SQL Server 2000. Similarly Oracle privide several JDBC Drivers to be used with Oracle databases.
    Sun has provided a JDBC-ODBC bridge (Driver) along with its JDK or JSDK. This driver is capable for connecting Java applications with any ODBC connection.
    Cuz this driver is included with the JDK/JSDK therefore you can use it to connect with for example MS Access DB or any other ODBC connected DB.
    If you want to connect your Java or J2EE application to some specific database then you should get the Driver for that particular database.
    regards,
    Humayun

  • How to find out in program which all classes have implemented an interface

    Hello,
    I have created an interface and few classes are implementing the interface.
    I want to know in a program which all class have implemented the interface.
    Is it possible to find it out and how?
    Regards,
    Bikash.

    Hi Bikash,
    Read the Database view VSEOIMPLEM with where condition REFCLSNAME = Interface Name and version = 1.
    This would give you all the classes which have implemented the interface and are active...
    If you want to look at the values that the field version can have then see Type Group SEOC ans search for version....
    Hope this help...
    Regards,
    Sitakant

  • How to get classes which implement the interface in program

    Hi,
    I created an interface and some classes are implementing it. I want to know in which classes the interface is implemented through program. I mean in which table the interface implemented details stores.
    please helps regarding this.
    Thanks,
    Regards,
    Priya

    Hi.,
    Read the  database view VSEOIMPLEM with where condition.,  REFCLSNAME =  <Interface Name> and Version = 1.
    This gives the class names which implement the interface.,
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • Concrete classes implement abstract class and implements the interface

    I have one query..
    In java collection framework, concrete classes extend the abstract classes and implement the interface. What is the reason behind extending the class and implementing the interface when the abstract class actually claims to implement that interface?
    For example :
    Class Vector extends AbstractList and implements List ,....
    But the abstract class AbstractList implements List.. So the class Vector need not explicitly implement interface List.
    So, what is the reason behind this explicit definition...?
    If anybody knows please let me know..
    Thanx
    Rajendra.

    Why do you post this question again? You already asked this once in another thread and it has been extensively debated in that thread: http://forum.java.sun.com/thread.jsp?forum=31&thread=347682

  • Class constructor that implements an interface returns an  "interface", why

    Hi,
    I am studying some code that I need to understand well. This code works, I just don't understand the following:
    A class was defined extending an interface as so:
    public class GeometricShape implements Area {
    // constructor
    public GeometricShape() {
    System.out.println('bla);
    In another file, GeometricShape class was instantiated as follows:
    public class ExampleUse {
    Area g = new GeometricShape();
    My qustion is, why does the code above expects "new GeometricShape()" constructor to return an interface of type Area?
    Can someone explain?
    thanks

    Can someone explain?When a class implements an interface, or extends another class, or when a interface extends another interface, it means that anywhere an instance of the parent class or interface is expected, the child can be used.
    Wherever a Mammal is expected, you can provide a Dog or Cat or Whale or Human or NakedMoleRat. Each of those is a mammal.
    If you say "give me some food," and you don't specify anything else, the person you're talking to can hand you a hamburger or an apple or a bowl of rice. Any of those will meet the requirements you put forth.
    This is how the OO "is-a" relationship maps to Java.

  • Reg Implementing the interfaces in JDBC

    Hi,
    When we do a program that deals with database connectivity,we are not implementing the Interfaces like Statement,ResultSet.But we are using those
    interfaces inside our program.
    Can anybody justify how it is possible.
    Thanks in advance

    The DB vendors are responsible for providing implementation classes for these interfaces. That's why we need to keep DB specific jar files in CLASSPATH when we do DB activities..
    Gautam

  • Maybe you are looking for

    • Error: 500 internal server error

      Hi everyone, I'm using sharePoint online and I want to add a new button for log out. I added this in my <asp:Content ContentPlaceHolder> <a href="/_layouts/SignOut.aspx">Log out</a> but I got 500 error. why is that? thank you!

    • SELECT statement comparing 2 fields in a table.

      Hi, Can someone help me out  in making a efficient SELECT statement for the follwing requirement. Say, I want to select all the records from a database table where the field, PLANT is equal to field SALESORG in the table (i.e., when both fields are e

    • Camera's USB device appears on iPhoto but nowhere on the Desktop

      Camera is Fuji F30 (previous was Fuji F700). With the F700 we could access the F700's USB memory directly from the Desktop which was very convenient (see other post in this area) Now we can see the F30 as an icon within iPhoto but nowhere as a USB de

    • Initialization DB-Connect Failed

      Hello, While starting j2ee instance, the disp+work process is stopping after about 1 minute. In the logs following error occur: SAP Basis System: Initialization DB-Connect Failed, Return Code 008192 Can some help me, to tell me where to find more det

    • OS error -43 cannot save pages

      Another user asked about OS error -43 and was apparently able to resolve it by changing permissions. I am having this same trouble on one of my GoLive-created sites, but I have not used a second computer. Specifically, I'm unable to create new pages