Interfaces in JDBC

Hi Everyone
i have a doubt regarding interfaces in JDBC api.my question is why SUN has made Connection,Statement,Resultset etc as interfaces in jdbc.why have they not made them as simple classes.Is there any specific reason behind this thing unless it is sun specific.plesae provide me your comments on the same.
regards
kvikram

This leaves more freedom to the implementors of the very drivers. They can inherit their implementing classes from some internal classes if they wish, which would not be the case if it were an abstract class and not an interface.
Abstract classes ususally contain some non-complete implementation, interfaces are "just" interfaces. The JDBC very much fits to interfaces.
So there is no reason for them to be abstract classes and there are reasons for them to be interfaces.

Similar Messages

  • What are the classes and interface in JDBC

    Please anybody tell me
    What are the Classes in JDBC?
    and
    What are the Interfaces in JDBC?
    Will you please show the classes in one table and interfaces in one table. Plesae
    regards
    pooja.

    Hi jeyan,
    Very more thanks. I am searching lot of time in net to exactly get the classes and interface in jdbc. Now you have given helpful link.
    thank you.
    regards
    pooja

  • Why all are interfaces in JDBC

    why all are interfaces in JDBC
    If anybody knows the answer tell me plz

    Because of encapsulation of major database functionality, such as running queries, processing results, and determining configuration information.
    JDBC interfaces is like a plug, where u can plug in any database to your application by adding there respective JDBC Driver.
    The JDBC Driver is a set of classes that implement the JDBC interfaces to process JDBC calls and return result sets to a Java application. Thats the magic of encapsulation, we just have to program to the interface rather than the implementation. The implementation might change regularly keeping the interface unchanged and hence our application.
    The one of the suggestion of design patterns, is , program to an inteface and not to an implementation.

  • Regarding message interfaces in JDBC implementation

    Hi Bhavesh,
         I have been trying to implement the jDBC scenario as mentioned by you in the blog "JDBC Receiver Adapter -- Synchronous Select – Step by Step",could you please help me out with interfaces(how many interfaces do we need on the whole).
    Regards
    Madhu

    Madhu,
    Please refrain from directing questions to someone in particular. There are lots of XI experts around here who can surely help and directing questions to one person is going to discourage others from answering .
    Answering your question~~ refer into this blog by Arpit and use the same concepts as he has described for File - RFC - File. The only difference will be in the datatypes and message types,
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
    Regards
    Bhavesh

  • 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

  • Why JDBC has mainly interfaces ?

    Hi,
    I was studying JDBS when a thought came to my mind.
    I can see mainly interfaces in JDBC, like the Statement interface,Connection Interface etc.Whys such a architecture?
    Can anyone let me know...
    With Regards

    The interfaces provide a known API that you the user can write your code against.
    The driver implementor (usually the database vendor) can then do whatever's necessary to support that interface.
    There are only a few classes in the spec because:
    * Most of the "hard" stuff tends to happen IN the database itself.
    * DB Vendor protocols tend not to have much in common.
    * The interfaces minimise the constraints placed upon the vendors when creating their implementations.

  • Calling Stored Procedure from Oracle DataBase using Sender JDBC (JDBC-JMS)

    Hi All,
    We have requirement to move the data from Database to Queue (Interface Flow: JDBC -> JMS).
    Database is Oracle.
    *Based on Event, data will be triggered into two tables: XX & YY. This event occurs twice daily.
    Take one field: 'aa' in XX and compare it with the field: 'pp' in YY.
    If both are equal, then
         if the field: 'qq' in YY table equals to "Add" then take the data from the view table: 'Add_View'.
         else  if the field: 'qq' in YY table equals to "Modify"  then take the data from the view table: 'Modify_View'.
    Finally, We need to archive the selected data from the respective view table.*
    From each table, data will come differently, means with different field names.
    I thought of call Stored Procedure from Sender JDBC Adapter for the above requirement.
    But I heard that, we cannot call stored procedure in Oracle through Sender JDBC as it returns Cursor instead of ResultSet.
    Is there any way other than Stored Procedure?
    How to handle Data Types as data is coming from two different tables?
    Can we create one data type for two tables?
    Is BPM required for this to collect data from two different tables?
    Can somebody guide me on how to handle this?
    Waiting eagerly for help which will be rewarded.
    Thanks and Regards,
    Jyothirmayi.

    Hi Gopal,
    Thank you for your reply.
    >Is there any way other than Stored Procedure?
    Can you try configuring sender adapter to poll the data in intervals. You can configure Automatic TIme planning (ATP) in the sender jdbc channel.
    I need to select the data from different tables based on some conditions. Let me simplify that.
    Suppose Table1 contains 'n' no of rows. For each row, I need to test two conditions where only one condition will be satisfied. If 1st condition is satisfied, then data needs to be taken from Table2 else data needs to be taken from Table3.
    How can we meet this by configuring sender adapter with ATP?
    ================================================================================================
    >How to handle Data Types as data is coming from two different tables?
    If you use join query in the select statement field of the channel then whatever you need select fields will be returned. This might be fields of two tables. your datatype fields are combination of two diff table.
    we need to take data only from one table at a time. It is not join of two tables.
    ================================================================================================
    Thanks,
    Jyothirmayi.

  • Sender JDBC Dynamic parameter value in select query

    Hi All,
    I have a scnario where i have read only acess to a table and We cannot use stored procedures..
    Interface is JDBC to file.
    Now there is one filed in the table which holdes the system date and time.Ex filed name as Sysdate.
    now can i use  query as select * from table1 where Sysdate = x+1.
    where X is the last process Sysdate field value.. is there any work arround to store the value in a file and check dynamically every time from that file to get the value of x and after that X+1 value has to be updated back to that file..
    main aim is to eliminate duplicate entries.
    Regards
    Vijay

    Hi suraj,
    thanks for the reply i have proposed the same for the requirement but there is no acess to update the table all we have is to read only the table.. so i get out one other way round to ensure the proper data has to be flow..
    Similarly there is one more where i have datetime field value  i need to break all entires on base of time and pick the values ...
    Even i proposed if you thre is no authorization to update the flag give me in flat file so that i can split the file by uisng java mapping..
    But its was badluck i have a table with few lak entries read only aces to the table and ensure data has to be properly flow with out any duplications and miss entries.. any approach that we can achive this..
    Regards
    Vijay
    Edited by: vijay Kumar on Apr 12, 2010 1:36 PM

  • Use of JTA API in JDBC programs.

    Hi,
    Where we can use JTA API in JDBC programs. what is the significance of UserTransaction interface in JDBC programs. I heard that when we are using two databases in same program then we use this JTA API. Can't we do this by using,
    connection.setAutoCommint(false);
    // code to work with two database
    connection.commit();
    does it wont work.
    Please suggest me.
    Thanks
    Satish

    I heard that when we are using two
    databases in same program then we use this JTA API.
    Can't we do this by using,
    connection.setAutoCommint(false);
    // code to work with two database
    connection.commit();This will work if there are no errors or crashes, but it can seriously fail otherwise.
    To find out more: you can download our JTA from http://www.atomikos.com and go through the JTA user guide. It includes the answer to your question.
    Alternatively, feel free to check our transactions community forum on http://www.atomikos-support.com/forums (which we check more often than this one).
    Best,
    Guy

  • Table Name on JDBC

    Hi Experts,
    If I am working on a outbound interface using JDBC (SAP to ODS) on direct insert and update, how can we check the target table name of ODS? I believe it's in somewhere of my Message Type or Message Interface? Or is it at the Communication Channel? I have no idea how can I look for it after several try and error.
    Example, the table SAP_INVOICE in ODS is ready for SAP to pump in data, where can I get the SAP_INVOICE value in my XI?
    Thanks.
    Cheers,
    Isaac.

    Refer this link : [JDBC Message Format|http://help.sap.com/saphelp_nw04/Helpdata/EN/2e/96fd3f2d14e869e10000000a155106/content.htm]
    Check the JDBC receiver Message Type.
    Or check converted XML in Communication Channel Monitoring (for JDBC).
    Thanks
    farooq

  • Question about message interface

    I developed a jdbc to file scenario, it works, but I'm confused.
    I designed a message interface for jdbc outbound,
    CustomerRow
    |--row
         |--CUST_NO
         |--......
    I set Document Name = 'resultset' in jdbc sender adapter.
    I can see payload in SXMB_MONI.
    <?xml version="1.0" encoding="utf-8" ?>
    - <resultset>
    - <row>
      <CUST_NO>pp3433</CUST_NO>
      <SALES_ORG>org1</SALES_ORG>
      <DISTRIBUTION_CHANNEL>dis1</DISTRIBUTION_CHANNEL>
      <DIVISION>div1</DIVISION>
      <FLAG>N</FLAG>
      <LAST_UPDATE>2008/11/05 15:24:53:843</LAST_UPDATE>
      </row>
    - <row>
      <CUST_NO>ppy3233</CUST_NO>
      <SALES_ORG>org2</SALES_ORG>
      <DISTRIBUTION_CHANNEL>dis2</DISTRIBUTION_CHANNEL>
      <DIVISION>div2</DIVISION>
      <FLAG>N</FLAG>
      <LAST_UPDATE>2008/11/05 15:24:53:843</LAST_UPDATE>
      </row>
      </resultset>
    You noticed that resultset is not 'CustomerRow' in message interface which I defined.
    I don't know how it can work.

    The parameter Document Name should ideallly contain ur Message Type root name. As u have changed it to 'resultset', it is replaced at the sender adapter and then flow continues.
    There are very few occasions when success raises a question
    Regards,
    Prateek

  • Reg http to jdbc Scenario

    Hi all,
    I am trying to execute a synchronous Http to Jdbc Scenario using MS Access  table as my back end.
    In design part ,I have followed the steps like
    1. Created a http req ,jdbc req, jdbc response ,and then http response in Data types and the in Message types.
    2.Created Outbound MI with http req and http response as input and output messages  respectively,then Inbound message interface with jdbc req and jdbc response as input and output messages respectively.
    3.In Message mapping with  Http req and jdbc req as request mappings and jdbc response and http response as Response mappings following the Action and access Steps.
    Thats Fine with design part
    IN Configuration Part, Since it is a Http Sender ,i didnt create any sender agreement and sender communicatin channel.
    Then Configured Jdbc adapter properly and i am able to access my table with that.
    While Executing ,I can find that my message is sent in Runtime workbench and can find that Jdbc adapter is Running by showing green flag.
    I was trying to send an empid of a table as  key and expecting to  retrieve  the complete row of the corresponding key.
    But I could not find the response even though everything is fine with XI.
    Where Could be the problem ,where can I see the response from jdbc adapter .
    Please help me out in solving this .
    Thanks and Regards,
    Kalpana

    Hi Kalpana,
    Can you check this weblog
    /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    This should help you...
    Check the Response Mapping,also you have one IM with Reqest and Response mapping...
    Also if you have SP16 then you can have sender CC for HTTP also ...
    Regards,
    sridhar

  • Build Issue(package weblogic.jdbc.vendor.oracle does not exist) weblogic10

    Hi All,
    I am getting below build error. I am migrating weblogic 10. Which jar file contains this interface: weblogic.jdbc.vendor.oracle.OracleThinClob?
    Error:
    package weblogic.jdbc.vendor.oracle does not exist [javac] if (theClob instanceof weblogic.jdbc.vendor.oracle.OracleThinClob)
    I already got weblogic.jar file from weblogic 10.
    Thanks,
    Srinivas

    Srinivas U wrote:
    Hi All,
    I am getting below build error. I am migrating weblogic 10. Which jar file contains this interface: weblogic.jdbc.vendor.oracle.OracleThinClob?
    Error:
    package weblogic.jdbc.vendor.oracle does not exist [javac] if (theClob instanceof weblogic.jdbc.vendor.oracle.OracleThinClob)
    I already got weblogic.jar file from weblogic 10.
    Thanks,
    SrinivasIt's in the datasource module/jar: modules/com.bea.core.datasource_1.0.0.0.jar

  • Payload issue in jdbc to proxy scenario

    HI Experts,
    We have designed a new interface from jdbc to proxy where in it went fine with the design part.
    But while testing it the records are pulled by XI but were not posting to ECC.
    So when collected the payload to test in mapping I see a red color to the fields in the structure. due to which am not able to get the output in mapping.
    Can anyone help me out how to resolve this issue.
    Appreciate the quick response.
    Thanks and regards,
    Ranganath.

    Add those Extra fields in your Data type and dont map it with target.
    or
    In select stataement in sender JDBC adapter mention the fieldname you want to pick
    Suppose employee table has 3 field
    EmployeeeID,
    Employeename
    address
    but you dont want address field then write the select query like this
    Select EmployeeeID, Employeename from employee
    mention the table fieldnames in select query which you have in your mapping source structure.
    if you are write select * from employee
    then address will come as extra field and create problem in mapping
    Refer this
    http://www.java2s.com/Code/SQLServer/Select-Query/Specificcolumnnamesaredefinedinthequery.htm

  • Xdb6.jar in JDBC Driver 11.2.0.3

    I noticed the following in the JDBC driver download section for 11.2.0.3
         xdb6.jar (262,740 bytes) - To use the standard JDBC4.0 java.sql.SQLXML interface with JDBC 11.2.0.3, you need to use xdb6.jar (instead of xdb.jar) from the 11.2.0.3 distribution..
    Can someone elaborate what this is ?
    From the brief description I gather, we may not need to use the propriatary oracle.xdb.XMLType , bet we can used java.sql.SQLXML type.
    Is this correct ? Any further documents for this ?
    Also can we then use only the jdbc thin driver, or do we still need to use the "thick" (oci) driver ? Coz from what I know, XMLTYpe could only be accessed with thick driver, because
    the thin dirver did not have all the code necessary for working with XMLType.
    Secondly, we also dequeue XMLType messages from a Oracle AQ. Can we use xdb6.jar there too, and dequeue java.sql.SQLXML , instead of oracle.xdb.XMLType ? And there too, can we
    use the thin driver ?

    The class that provides the Oracle Implementation of JDBC 4.0 Interface java.sql.SQLXML also implements the XMLType interface. So the object returned when an XMLType is part of the result set of a SQL statement can be cast either way. java.sql.SQLXML is still a somewhat inferior implementation in terms of the functionality it provides, but if it meets your needs you can now use it in conjunction with XMLType stored in the database. If you find that you need the richer capabilities of XMLType, you should be able to CAST your java.sql.SQLXML object to XMLType.

Maybe you are looking for

  • Material Price Analysis-CKM3N

    Dear Gurus, I'm new in material ledger and need advise for material price analysis in CKM3N. There is a value from receipt from next level 13,282,838. where cause value change 1,383,641 and new price change 365,125. How to analyse this casue of singl

  • Authorization object L_LGNUM

    Dear colleagues, I am trying to restrict a user from doing a certain 'thing' and am looking for your help. In Warehouse Management we are confirming Transfer Orders in Two steps. I want the user that does the first step, not to be able to confirm the

  • Stupid Mac OS 10.4 and Quicktime Questions

    How can I get the intro video on Tiger to play again. I just reinstalled tiger and was going through the setup process and it played the little welcome vid. About Quicktime When there is a quicktime update that is like for example qt 7.0.1 to 7.0.2 d

  • Layout help

    hey im have a serious problem with the layout manager. i started programing using the netbeans ide's null layout manager, and only now i found it that when changing the resolution it messes up eevrything. i tried using diffrent layouts, but nothing w

  • Wrong language - sometimes

    Sometimes in installation panels the default language appears as Danish instead of UK English. It can happen with Apple and other installations. I am just setting up an iPhone 3GS and its 'charging' message (I assume!?) was in what looked like Danish