Skip to Content
author's profile photo Former Member
Former Member

Connecting to MSSQL using JCA


Can any one help me by providing detailed information regarding connecting to MSSQL using JCA.

Do we need any Resource Adapters(.rar) files to be deployed on to the server.If so please guide me.

Thanx in Advance,


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2004 at 07:55 AM


    Sure thing, first u have to define ur Services in the PortalApps.xml. Once u do that then u will be on ur way. I attaching the Sample portal apps and also the sample code.

    <?xml version="1.0" encoding="utf-8"?>



    <property name="ServicesReference" value=",,,,,,, usermanagement,, , landscape, jcoclient"/>

    <property name="releasable" value="true"/>



    <component name="empSearch">


    <property name="ClassName" value=""/>

    <property name="SecurityZone" value=""/>



    <property name="System" value="SAP_ED"/>

    <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>






    Above view the <application-config> tags where we have defined the services. Please note the example I will be showing uses the Database with an Alias, just ask ur system admin to mount the database for u as using an Alias is mich more simpler.

    private IConnection getJDBCConnection(

    String systemAlias,

    IPortalComponentRequest request)

    throws ConnectorException, Exception {

    try {

    IConnectorGatewayService cgService =

    (IConnectorGatewayService) PortalRuntime




    if (cgService == null) {

    throw new ConnectorException("Error in get Connector Gateway Service");


    // Use the Connector Gateway to get connection to JDBC DB

    ConnectionProperties cp =

    new ConnectionProperties(



    return cgService.getConnection(systemAlias, cp);

    } catch (NoLogonDataAvailableException e) {

    throw new ConnectorException(

    "*** No Logon Data supplied: "

    + e.getNestedException().getLocalizedMessage());

    } catch (ConnectorException e) {

    throw new ConnectorException(

    "*** Connector Exception: "

    + e.getLinkedException().getLocalizedMessage());



    This will establish the connection, and this code works very well, so try it out and if u have any difficulties let me know.

    Please score my reply, thanks.

    Best Wishes,


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Emmanuel,

      Thanks for responding.The method u gave is correct.It works fine,with that method I already did

      an example which connects R3 system.As I mentioned

      in previous post.I need information regarding .rar files

      and deploy tool.I was trying to deploy jdbcconnector.rar file using deploy tool but could not do it.

      I am trying an example containing this line.

      connectionFactory = (IConnectionFactory)initctx.lookup("EISConnections/JDBCFactory");

      To execute this line,I think we need to deploy .rar files with deploy tool.But I am unable to do so..

      Do u have any idea in this regard.Help me



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.