What is javax.sql.XADataSource

would someone kindly explain what is xadatasource? in comparison with the plain datasource. thanks in advance.

An XADatasource always provides XAConnection objects. where as a regular Datasource provides
regular connections to a datasource mostly from a connection pool.
According to the JDBC Spec, An XADatasource object creates XAConnection objects, connections
derived from PooledConnection that can be used for distrubuted transactions.  An application that uses
distributed transactions will need to be run using a JDBC driver that supports the XADatasource and
XAConnection interfaces. As a matter of fact., XA connection objects are those that are used for distributed transaction support in
J2EE. They can be used by the transaction manager to do distributed transactions, to various databases,
in various locations. The XAConnection also provides method to get the XAResource, which the
transaction manager uses to do the commit of the transactions by the two phase commit protocol.
So only if you intend to use distributed transactions, use the twophase commit, and use the transaction
manager feature, you need to worry about XADatasources. Everything else, you can do it through a
Datasource.
HTH..
Jer

Similar Messages

  • What is the diffrence between package javax.sql and java.sql

    Is javax designed for J2EE?
    And when to use package javax?

    Hi,
    What is the diffrence between package javax.sql and java.sql?The JDBC 2.0 & above API is comprised of two packages:
    1.The java.sql package and
    2.The javax.sql package.
    java.sql provides features mostly related to client
    side database functionalities where as the javax.sql
    package, which adds server-side capabilities.
    You automatically get both packages when you download the JavaTM 2 Platform, Standard Edition, Version 1.4 (J2SETM) or the JavaTM 2, Platform Enterprise Edition, Version 1.3 (J2EETM).
    For further information on this please visit our website at http://java.sun.com/j2se/1.3/docs/guide/jdbc/index.html
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Micro Systems
    http://www.sun.com/developers/support/

  • Javax.sql.rowset.serial.SerialBlob cannot be cast to oracle.sql.BLOB

    Hi there,
    I'm facing this exception.
    My code:
    final ReportTemplateAttachment rta = new ReportTemplateAttachment();
    FileBlob fb = new FileBlob();
    fb.setContentType(attachmentDto.getContentType().getValue());
    fb.setCreationDate(sysDate);
    fb.setCreationUser(userId);
    final SerialBlob blob = new SerialBlob(attachmentDto.getFileVal());//it's a  byte[]
    //SerialBlob is of type javax.sql.rowset.serial.SerialBlob
    fb.setFileData(blob);
    fb.setName(attachmentDto.getFileName());
    fb.setLastUpdateDate(sysDate);
    fb.setLastUpdateUser(userId);
    fb.setLength(blob.length());
    rta.setFileBlob(fb);and the object rta will be inserted into another object.
    The variable of interest in FileBlob hbm is defined as follows:
    <property name="fileData" type="blob">
                <column name="FILE_DATA" />
    </property>where the type blob is oracle.sql.BLOB
    If I change the oracle.sql.BLOB to javax.sql.rowset.serial.SerialBlob in the hbm, I can insert but when I try to get the blob back I get a deserialize exception so this change is not an option.
    but when I save the main Object (a cascade operation) I get the following exception:
    org.springframework.jdbc.UncategorizedSQLException:
    Hibernate flushing: could not insert: [pt.sc.data.entities.FileBlob];
    uncategorized SQLException for SQL
    [insert into WP_ADMIN.file_blob (name, content_type, length, file_data, status, creation_user, creation_date, last_update_user, last_update_date, id)
    values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)];
    SQL state [null];
    error code [0];
    An SQLException was provoked by the following failure: java.lang.ClassCastException:
    javax.sql.rowset.serial.SerialBlob cannot be cast to oracle.sql.BLOB;
    nested exception is java.sql.SQLException: An SQLException was provoked by the following failure:
    java.lang.ClassCastException: javax.sql.rowset.serial.SerialBlob cannot be cast to oracle.sql.BLOBAny light on the subject?
    Thanks in advance,
    mleiria

    You don't seem to understand the difference between an object model and a database. Hibernate, being an ORM package, works on the object model and will, based on what you request it to do, generate proper SQL statements to get the database part going. But you shouldn't be thinking about databases when using Hibernate; your main focus is the object model. There is no blob, only binary data. Binary data in Java is generally handled through a byte array.
    If you want to think in databases where blobs do exist, you should be using JDBC directly, not Hibernate.
    (I'm far from being an expert in Hibernate)I would really suggest taking a few hours and reading through the manual. You don't need to be an expert but you should at least know what kind of tool you're working with.

  • Package not found javax.sql.*

    Hi I'm trying to import the following and compile.
    It prompts me package not found for javax.sql.* ?
    Any idea what is going wrong ?
    Thanks.
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    import javax.naming.*;

    I got it right. Just download the jdbc optional package and put it in the classpath.

  • Differ java.sql.* and javax.sql.*

    Dear Friends,
    What is differenece between java.sql.* and javax.sql.*?.
    Advance in thanks

    java.sql is the package you can use for all basic kinds of database access. If you are not developing a full scale enterprise application, java.sql package is all that you need.
    javax.sql is extension to the basic java.sql package. It includes classes that allow connection pooling and rowsets, among others.
    If you are just getting started with JDBC, you just need to get familiar with java.sql and leave the wonders of javax.sql until later.

  • Unable to view javax.sql.*

    can someone explain what i may have done wrong
    i'm unable to view javax.sql.*,
    i have downloaded the jdbc driver jdbc2_0_1-stdext.jar into <dir>:\jdk1.3.1\lib and included this file into the classpath...
    i someone could give me futher direction would be extremely helpful...
    thanks

    hello,
    you can put the jdbc2_0_1-stdext.jar in your webapp.
    For example,you can put it under the directory "./webapps/yourWebApp/Web-inf/lib/".
    Try it.
    good luck!

  • [WLS 8.1] - AbstractMethodError using javax.sql.DataSource  getConnection()

    [WLS 8.1.3] I'm getting an error while trying to execute the getConnection() method of javax.sql.DataSource.
    The same code, test data, WLS JDBC connection & data source runs fine on HP-UX but when I try to run it on XP, I get an error.(see below) Our code calls the getConnection() method several times and it actually works the first few times in the transaction but then fails after the 5th or 6th call. We're using the weblogic.jdbc.oci.Driver in both HP-UX & XP and the JDBC settings are identical. I've tried the same query in SQLPLUS as what's being used in the prepared statement and it works fine.
    The error message is as follows:
    Transaction BEA1-0002AD72C454EBACDA96 not active anymore. tx status = Marked rollback. [Reason=java.lang.AbstractMethodError: weblogic.xml.schema.binding.BeanCodecBase.getCompositor()Lweblogic/xml/schema/binding/ModelGroupCompositor;]>
    The code snippet that gets the error:
    Context ctx = new InitialContext();
    ds = (javax.sql.DataSource) ctx.lookup ("com.xxxx.yyyy.zzzz");
    conn = ds.getConnection();
    Any ideas what could cause this error?

    I turned JDBC logging on but the only SQLExceptions I could find in the JDBC log where some "java.sql.SQLException: Result set already closed" errors. Not ideal but the db calls actually worked and those errors were not in the same place in the code. I'm looking into why these are occurring but I don't think this is the root problem of the AbstractMethodError as the same SQLException occurs in the JDBC logs on UNIX where the AbstractMethodError is not being thrown. I can include a stack trace of the SQLException if you still think it might help.
    While searching the logs, I found other occurrences of the AbstractMethodError. I also noticed there is a JDK version difference between the WLS 8.1.3 for XP and the one for HP-UX. The XP version has JDK 142_04 and the HP-UX has 142_03.
    Here's a stack trace of the other AbstractMethodError I found from one of the EJB's:
    ####<Oct 6, 2004 6:41:35 AM PDT> <Info> <EJB> <JEAGLEMXP> <lnppiServer> <ExecuteThread: '14' for queue: 'weblogic.kernel.Default'> <<anonymous>> <BEA1-00009C0656BCEBACDA96> <BEA-010051> <EJB Exception occurred during invocation from home: com.qwest.lnppi.business.port.PortedTnEjb_rn88fn_HomeImpl@26d560 threw exception: java.lang.AbstractMethodError: weblogic.xml.schema.binding.BeanCodecBase.getCompositor()Lweblogic/xml/schema/binding/ModelGroupCompositor;
    java.lang.AbstractMethodError: weblogic.xml.schema.binding.BeanCodecBase.getCompositor()Lweblogic/xml/schema/binding/ModelGroupCompositor;
         at weblogic.xml.schema.binding.BeanCodecBase.gatherContents(BeanCodecBase.java:299)
         at weblogic.xml.schema.binding.CodecBase.serializeFill(CodecBase.java:285)
         at weblogic.xml.schema.binding.CodecBase.serialize_internal(CodecBase.java:222)
         at weblogic.xml.schema.binding.CodecBase.serialize(CodecBase.java:181)
         at weblogic.xml.schema.binding.RuntimeUtils.invoke_serializer(RuntimeUtils.java:188)
         at weblogic.xml.schema.binding.RuntimeUtils.invoke_serializer(RuntimeUtils.java:174)
         at weblogic.webservice.core.DefaultPart.invokeSerializer(DefaultPart.java:324)
         at weblogic.webservice.core.DefaultPart.toXML(DefaultPart.java:297)
         at weblogic.webservice.core.DefaultMessage.toXML(DefaultMessage.java:645)
         at weblogic.webservice.core.ClientDispatcher.send(ClientDispatcher.java:206)
         at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:143)
         at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
         at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
         at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:290)
         at com.qwest.lnppi.portedTNservice.PortedTelephoneNumber_Stub.getPortedTelelphoneNumber(Unknown Source)
         at com.qwest.lnppi.business.port.PortedTnBean.portedTnWS(Unknown Source)
         at com.qwest.lnppi.business.port.PortedTnBean.portedTn(Unknown Source)
         at com.qwest.lnppi.business.port.PortedTnEjb_rn88fn_EOImpl.portedTn(PortedTnEjb_rn88fn_EOImpl.java:98)
         at com.qwest.lnppi.business.svc.GetCurrentServiceProviderSwitch.getCurrentServiceProviderSwitch(Unknown Source)
         at com.qwest.lnppi.business.svc.LnppiServiceBean.getPortingOptions(Unknown Source)
         at com.qwest.lnppi.business.svc.LnppiServiceEjb_tk1dpv_EOImpl.getPortingOptions(LnppiServiceEjb_tk1dpv_EOImpl.java:46)
         at com.qwest.lnppi.web.lnppiTester.Tester.CallTheBean(Unknown Source)
         at com.qwest.lnppi.web.lnppiTester.Tester.TestIt(Unknown Source)
         at jsp_servlet.__tester._jspService(__tester.java:157)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:312)
         at com.qwest.lnppi.web.lnppiTester.pgMgr.doTestIt(Unknown Source)
         at com.qwest.lnppi.web.lnppiTester.pgMgr.service(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    >

  • Where to find package javax.sql

    Hi,
    I am getting the following error when I am trying to use DataSource.
    package javax.sql does not exist
    I have included weblogic.jar in the classpath.
    What else do I need to include?
    Thanks.

    You have to set the WLS environment.Go to BEA_HOME\user_projects\domains\YOUR_DOMAIN
    and then run the command setEnv after that try to compile the java program.It will work.

  • What are the SQL server versions those are compatible with XI 3.0.

    Hi All,
    Please suggest,
    what are the SQL server versions those are compatible with XI 3.0.
    or with which SQL server versions XI 3.0 will interact using JDBC Adapter.

    Check in the [Product Availability Matrix |https://websmp201.sap-ag.de/~form/handler?_APP=00200682500000001303&_EVENT=DISP_NEW&00200682500000002804=01200314690900000192]in market place for more information on this
    Thanks
    SaNv...

  • Compile problem with javax.sql

    I have upgraded to sdk 1.4.2 and tried to compile my code. I am getting an error on import javax.sql.* where I am getting the message "Package does not exist" error. As the result of this any class that is in this package gets an error as well. I am using ant to do the build. It does not seem to have a problem with the other import files and some of my code do compile fine except for this one that contains javax.sql.*. Thanks for your help.

    Are you sure that the javax.sql.* stuff exists in your javac classpath? It seems not to be there. Look for j2ee.jar (from Sun J2EE SDK), or something like that (something like it probably came with your app server).
    Mike

  • What version of SQL Server support ssl connection with TLS. 1.2 (SHA-256 HASH)

    Hi,
    I just want to know,
    What version of SQL Server support ssl connection with TLS. 1.2 (SHA-256 HASH).
    if support already,
    how can i setting.
    plz.  help me!!! 

    The following blog states that SQL Server "leverages the SChannel layer (the SSL/TLS layer provided
    by Windows) for facilitating encryption.  Furthermore, SQL Server will completely rely upon SChannel to determine the best encryption cipher suite to use." meaning that the version of SQL Server you are running has no bearing on which
    encryption method is used to encrypt connections between SQL Server and clients.
    http://blogs.msdn.com/b/sql_protocols/archive/2007/06/30/ssl-cipher-suites-used-with-sql-server.aspx
    So the question then becomes which versions of Windows Server support TLS 1.2.  The following article indicates that Windows Server 2008 R2 and beyond support TLS 1.2.
    http://blogs.msdn.com/b/kaushal/archive/2011/10/02/support-for-ssl-tls-protocols-on-windows.aspx
    So if you are running SQL Server on Windows Server 2008 R2 or later you should be able to enable TLS 1.2 and install a TLS 1.2 certificate.  By following the instructions in the following article you should then be able to enable TLS 1.2 encryption
    for connections between SQL Server and your clients:
    http://support.microsoft.com/kb/316898
    I hope that helps.

  • Cannot access class javax.sql.RowSet

    Hello everyone,
    I had a question about this error I am receiving "cannot access class.javax.sql.RowSet". I have put the RowSet.jar file into my jdk/jre/lib/ext directory and when I compile I recieve this error. Can Anyone help? Thanks!

    I think you need to add one (or more) of the available libraries to your project, in your project's settings dialog, but I'm unsure which. If you can't find the correct one, you can always add a newly created one, which holds a reference to your jar file.

  • What is dbowner.sql file?

    what is dbowner.sql file?

    I saw your another question too...What is your db? There is some slight difference between oracle and sql server installations. based on that your database rights have to be granted. dbowner creates the db only.

  • What is PL/SQL Catridge, where it will be used and when?

    What is PL/SQL Catridge, where it will be used and when? I am using Devloper 6i, Oracle 8i.
    Thanks in advance.

    Hi,
    In the application Special Purpose Ledger, you can define ledgers for reporting purposes. You can keep these user-defined ledgers as general ledgers or subsidiary ledgers with various account assignment objects. Account assignment objects can either be SAP dimensions from various applications (such as account, cost center, business area, profit center) or customer-defined dimensions (such as region).
    The special purpose ledgers enable you to report at various levels using the values from the various application components. The functions available in the special purpose ledgers enable you to collect and combine information, create and modify totals, and distribute actual and plan values. The values are transferred to the special purpose ledgers from other SAP applications and external systems.
    You can find more info here:
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/d5/6ada3889432f48e10000000a114084/frameset.htm
    Regards,
    Eli

  • How to instantiate javax.sql.rowset.CachedRowSet?

    When trying to instantiate javax.sql.rowset.CachedRowSet, I get the foll error...
    javax.sql.rowset.CachedRowSet is abstract; cannot be instantiated
    Any solutions plz...

    You need to instantiate the standard reference implementation. As follows
    javax.sql.rowset.CachedRowSet crs = new com.sun.rowset.CachedRowSetImpl()
    Take a look at JDBC Technology Homepage and grab a copy of the JDBC RowSet Co-Bundle. You'll find a very useful tutorial in that bundle that will assist you.

Maybe you are looking for