Need help on JDBC

Hi All,
I need a solution on one of the requirement. Could you please help me on this.
Requirement:
I have to set up a interface between SQLServer and SAP HR using SAP XI. There is one constraint on database. We should not insert/update the data to the existing database table and can create other database if needed. Interface should run by every hour. one unique field transaction is there in the table.
My doubt is how can we ensure that not to read any duplicate records every time.
These are the possibilities :
  Option 1 :
Create another database and table with additional update flag and transfer the whole data from the original database to this newly created database table using triggers.
          We need to poll the data from the newly database table and update the status every time.
Disadvantage : Maintenance of additional data base is to push the effort and also would introduce complexity.
          Any comments on this solution ??
  Option 2:  Read the whole data from DB and send the data to proxy.
                proxy should do the following.
a)     Insert the whole data in Ztable (we need to create Ztable in SAP HR)
b)     Call the BAPI to update the SAP HR data
c)     Select max(Transaction) from the ZTable.
d)     Need to pass this parameter to the JDBC adapter  (to ensure that not to read duplicate records)
e)     Adapter will read the  data from next transaction ID basing on this parameter in next poll.
   My doubt would be is there any option that we can call Adapter from receiver proxy and pass this dynamic parameter(Transaction) ??
Please review this and provide best possible solution.
I am waiting for your reply.
Regards,
Sekhar D

HI,
can we call the adapter from proxy to pass this dynamic parameter
Yes ofcourse.
U use the IP address of the server along with the communication component and communication channel... and u can
call a adapter passing the parameters.
Please search in SDN for the same.. there are lot of blogs and wiki available.
Babu

Similar Messages

  • Need help with jdbc and cursor

    Hi all,
    I know I can specify a cursor to be scrollable with
    cs = conn.prepareCall("{call server.procedure(?,?)}",ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
    but my problem is that this cursor is returning 2 oracle cursors and I need to move inside those but I cannot find the way to do it.
    cs.registerOutParameter(2, OracleTypes.CURSOR);
    rs = (ResultSet) cs.getObject(2); //this is the first cursor and is scrollable
    rs1= (ResultSet) rs.getObject(1); //this is one of the cursors inside the cursor and I cannot make it scrollable
    Thanks for the help,
    A.

    well, I didn't really check if the first one was scrollable since I didn't need it to be, but it seems that Oracle does not support scrollable cursors as out parameter of a stored procedure...
    anybody has a workaround?

  • Need help for jdbc..

    hi everyone,
    when connecting GUI to javaDB, i can insert data in table of one database, but in same way, when i try to insert data in table of another database, it gives error that 'table' doesn't exist. All other things are same, but even if i only change the name of database and table, it shows same error. please help.............

    hi everyone,
    when connecting GUI to javaDB, i can insert data in
    table of one database, but in same way, when i try to
    insert data in table of another database, it gives
    error that 'table' doesn't exist. You need a separate connection for each database. You can't use the same connection you made to the first one to write anywhere else.
    If you're writing to two separate databases, and you want the two operations to be a single unit of work, you'll need XA drivers and a transaction manager.
    All other things
    are same, but even if i only change the name of
    database and table, it shows same error. please
    help.............Who knows? You're doing it wrong, and Java is telling you so. Sounds like you're using the first connection to write to a table that exists in the second database. Post some code.
    %

  • Need help configuring JDBC Realm on Tomcat 4.0.1

    I'm getting the following error:
    (from DOS prompt)
    Starting service Tomcat-Standalone
    Apache Tomcat/4.0.1
    Catalina.start: LifecycleException:  Exception opening database connection:  jav
    a.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name too long
    LifecycleException:  Exception opening database connection:  java.sql.SQLExcepti
    on: [Microsoft][ODBC Driver Manager] Data source name too long
            at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615)
            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)Here's my attempted configuration:
                <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
                     driverName="sun.jdbc.odbc.JdbcOdbcDriver"
                    connectionURL="jdbc:odbc:DSNname@host_string:1521:ORCL?user=user_name;password=pwd_name"
                    userTable="chg_users" userNameCol="user_name" userCredCol="user_pass"
                    userRoleTable="chg_users_roles" roleNameCol="role_name" />Any help would be appreciated!
    Thanks!

    connectionURL="jdbc:odbc:CATALINA"
    in this case, where is CATALINA supposedly pointing
    to a DB connection? I don't have mine set, save for
    maybe the classpath, but why would you point the
    connURL through jdbc:odbc to CATALINA?
    That is the name of a DNS. The ODBC shell (nothing to do with java) has DNS names. The shell uses the passed in name to look up the attributes associated with the name.
    If you were using a DNS-less name then you would have to specify ODBC driver (nothing to do with java) and the associated attributes for that driver in the connection string.
    I'm a little confused by this. Any explanation would
    be great, as I have a driver that is jdbc:odbc,
    rather than an exclusive Oracle driver.
    Well, I've got the ojdbc14_g.jar file. But that's not
    exclusively Oracle, correct? Just for JDBC with
    Oracle?
    A jdbc driver lives somewhere. The bridge driver lives in the Sun VM. The Oracle driver lives in a jar (current ones.)
    The bridge driver talks to ODBC (which is outside of java.)
    The oracle drivers talk to oracle databases.

  • Need help in logging JTDS data packets

    Hi All,
    I m having web application which uses SQL Server database.
    I have to find out some problems in database connection for that there is need to log the jtds data packets.
    I have tried to use class net.sourceforge.jtds.jdbc.TdsCore but in constructor of TdsCore class there are two parameters needed one is ConnectionJDBC2 and another is SQLDiagnostic.
    I have tried a lot but it did not allow me to import class *SQLDiagnostic*.
    I need help in logging JTDS data packets. If there are any other ways or any body having any idea about logging JTDS data packets/SQLDiagnostic.
    Please reply it is urgent...!!
    Thanks in advance......!!

    if you want to use log4j then,
    in your project create a file called log4j.properties and add this
    # Set root logger level to INFO and its only appender to ConsoleOut.
    log4j.rootLogger=INFO,ConsoleOut
    # ConsoleOut is set to be a ConsoleAppender.
    log4j.appender.ConsoleOut=org.apache.log4j.ConsoleAppender
    # ConsoleOut uses PatternLayout.
    log4j.appender.ConsoleOut.layout=org.apache.log4j.PatternLayout
    log4j.appender.ConsoleOut.layout.ConversionPattern=%-5p: [%d] %c{1} - %m%n
    log4j.logger.org.apache.jsp=DEBUG
    #Addon for
    com.sun.faces.level=FINEGo to your class and add this line
    private static final Logger logger = Logger.getLogger("classname");and then you can use
    logger.info();
    logger.error();
    methods

  • Need help toUpdate or insert in to AS400 database

    Hi all,
    I have created one scenario in which I am using JDBC receiver adapter,
    now the database at the end which is to be updated is the AS400 database
    which has the concept of liabraries and staging tables.
    while mapping the Inbound message type I use the structure as
    <MT>
      <Statement>
           <Tablename>
                  action
                <access>
                      <field1>
                      <field2>
                <key>
    I assign a const. 'update_insert' to action attrib. but when I activate the adapter at the end the error I get is :
    'field1' column does not exists in 'Tablename'
    But when I use a JAVA code for doing the same the data is successfully updated on the database.
    I tried the same thing using MS Access database it works fine but not AS400
    need help.
    Thanks
    Ranjit

    Ranjith,
    The process is the very same for  AS400 too. We are doing operations with AS400 and we dint face any problems. Hope you have already deployed the JDBC drivers in your XI server.
    Change your Data type slightly.
    <MT>
    <Statement>
    <table action = UPDATE_INSERT>
    <table>specify the table name in library.table  name eg: LIBRARY.TABLE1</table>
    <access>
    <field1>a</field1>
    <field2>2</field2>
    <access>
    <key>
    <field1>a</field1>
    </key>
    </Statement>
    </MT>
    Regards,
    Jai Shankar

  • Need help for reporting

    hi,
    Hope I did not post to the wrong place. but I really need help here. I've been using Crystal Report all these while before I tried out java. However, there is a problem here.
    I've been doing some complex reports that comes with subreports and grabing values from the program. but there is no one program that i found can really support the reporting in java. I've even tried the crystal clear and Jbuilder enterprise trial version (which comes with crystal report). but I still can't get the output that I want.
    So, I'm here to ask :
    1. what sort of reporting system r u using that is recommended?
    2. And if I were to continue supporting crystal report where can I get a better component that supports crystal report ?
    3. And where can I get tutorials for java integration with crystal reports?
    thanks.

    Also check out i-text. It's an open source Java -> PDF tool. You will need to write a mapper to go from JDBC ResultSet to your own custom Java class. Otherwise, it is almost like writing HTML programatically.
    - Saish

  • XI Realtime scenarios-need help

    Hello experts,
    I am new to XI and I need help with real time XI scenarios.
    can you please give me 2-3 examples of What kinds of systems involve in data transfer (both sap and non sap) for transfer of what kinds of data (general IDOCs, RFCs and other kinds of data)
    and what is the purpose of that scenario? also how many times the data will be transferred between the systems?
    Thanks in advance,
    Haritha.
    useful answers will be rewarded ***

    Hi Haritha,
        Hi,
    Please go through the following are the links.
    Maybe this is a good start:
    http://help.sap.com/saphelp_nw04/helpdata/en/80/8e3841e26cef23e10000000a155106/frameset.htm
    <http://help.sap.com/saphelp_nw04/helpdata/en/80/8e3841e26cef23e10000000a155106/frameset.htm>
    https://www.sdn.sap.com/irj/sdn/developerareas/xi?rid=/webcontent/uuid/a680445e-0501-0010-1c94-a8c4a60619f8 [original link is broken]
    <https://www.sdn.sap.com/irj/sdn/developerareas/xi?rid=/webcontent/uuid/a680445e-0501-0010-1c94-a8c4a60619f8 [original link is broken]>
    This might help you
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    <http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm>
    Further, this thread deals with everything that is needed for a starter
    on XI. Do check them out,
    JDBC Receiver: exact SQL statement
    <JDBC Receiver: exact SQL statement>
    /message/527697#527697 [original link is broken]
    </message/527697#527697 [original link is broken]>
    And after you are done with the documentation probably you can go
    through this scenario,
    JDBC Receiver: exact SQL statement
    <JDBC Receiver: exact SQL statement>
    Also check the following threads which might help you a little more,
    Learning XI
    <Learning XI>
    XI 3.0 Training
    <XI 3.0 Training>
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/13926f23-0a01-0010-149c-c1170e7a25db
    <https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/13926f23-0a01-0010-149c-c1170e7a25db>
    /people/sravya.talanki2/blog/2006/12/25/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-i
    </people/sravya.talanki2/blog/2006/12/25/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-i>
    /people/sravya.talanki2/blog/2006/12/26/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-ii
    </people/sravya.talanki2/blog/2006/12/26/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-ii>
    /people/sravya.talanki2/blog/2006/12/27/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-iii
    </people/sravya.talanki2/blog/2006/12/27/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-iii>
    and once you are through ...follow the following links to weblogs which
    explain all the basic scenarios in XI
    Following are the links to weblogs which will help to develop the basic
    scenarios.
    /people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters
    </people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters> - IDoc to
    File
    /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy
    </people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy> - ABAP
    Proxy to File
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    </people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30> - File to
    JDBC
    /people/prateek.shah/blog/2005/06/14/file-to-r3-via-abap-proxy
    </people/prateek.shah/blog/2005/06/14/file-to-r3-via-abap-proxy> - File to
    ABAP Proxy
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    </people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1> - File to
    File Part 1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    </people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2> - File to
    File Part 2
    /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping
    </people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping> - Any flat
    file to any Idoc
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
    </people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit> - File to
    RFC
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    <https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]> - File to
    Mail
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    </people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i> - Dynamic File Name Part 1
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    </people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii> - Dynamic File Name Part 2
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    </people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address> - Dynamic
    Mail Address
    /people/siva.maranani/blog/2005/05/25/understanding-message-flow-in-xi
    </people/siva.maranani/blog/2005/05/25/understanding-message-flow-in-xi> - Message
    Flow in XI
    /people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm
    </people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm> - Walk
    through BPM
    /people/siva.maranani/blog/2005/05/22/schedule-your-bpm
    </people/siva.maranani/blog/2005/05/22/schedule-your-bpm> - Schedule
    BPM
    /people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi
    </people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi> - Use of
    Synch - Asynch bridge in ccBPM
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1403 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    <https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1403 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]> - Use of
    Synch - Asynch bridge in ccBPM
    /people/michal.krawczyk2/blog/2005/08/22/xi-maintain-rfc-destinations-centrally
    </people/michal.krawczyk2/blog/2005/08/22/xi-maintain-rfc-destinations-centrally> - Maintain
    RFC destination centrally
    /people/sravya.talanki2/blog/2005/08/18/triggering-e-mails-to-shared-folders-of-sap-is-u
    </people/sravya.talanki2/blog/2005/08/18/triggering-e-mails-to-shared-folders-of-sap-is-u> -
    Triggering Email from folder
    /people/sravya.talanki2/blog/2005/08/17/outbound-idocs--work-around-using-party
    </people/sravya.talanki2/blog/2005/08/17/outbound-idocs--work-around-using-party> - Handling
    different partners for IDoc
    /people/siva.maranani/blog/2005/08/27/modeling-integration-scenario146s-in-xi
    </people/siva.maranani/blog/2005/08/27/modeling-integration-scenario146s-in-xi> - Modeling Integration
    Scenario in XI
    /people/michal.krawczyk2/blog/2005/08/25/xi-sending-a-message-without-the-use-of-an-adapter-not-possible
    </people/michal.krawczyk2/blog/2005/08/25/xi-sending-a-message-without-the-use-of-an-adapter-not-possible> - Testing
    of integration process
    /people/michal.krawczyk2/blog/2005/05/25/xi-how-to-add-authorizations-to-repository-objects
    </people/michal.krawczyk2/blog/2005/05/25/xi-how-to-add-authorizations-to-repository-objects> -
    Authorization in XI
    http://help.sap.com/saphelp_nw04/helpdata/en/58/d22940cbf2195de10000000a1550b0/content.htm
    <http://help.sap.com/saphelp_nw04/helpdata/en/58/d22940cbf2195de10000000a1550b0/content.htm>
    - Authorization in XI
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
    </people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step> - Alert
    Configuration
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--troubleshooting-guide
    </people/michal.krawczyk2/blog/2005/09/09/xi-alerts--troubleshooting-guide> - Trouble
    shoot alert config
    /people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
    </people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi> - Call
    UNIX Shell Script
    /people/sravya.talanki2/blog/2005/11/02/overview-of-transition-from-dev-to-qa-in-xi
    </people/sravya.talanki2/blog/2005/11/02/overview-of-transition-from-dev-to-qa-in-xi> -
    Transport in XI
    /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping
    </people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping> - Using
    ABAP XSLT Extensions for XI Mapping
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    </people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure> - Mail Adaptor options
    /people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm
    </people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm> -
    Collection of IDoc to Single File
    /people/sap.user72/blog/2005/11/17/xi-controlling-access-to-sensitive-interfaces
    </people/sap.user72/blog/2005/11/17/xi-controlling-access-to-sensitive-interfaces> -
    Controlling access to Sensitive Interfaces
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    </people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14> - The same
    filename from a sender to a receiver file adapter - SP14
    /people/prasad.illapani/blog/2005/11/14/payload-based-message-search-in-xi30-using-trex-engine
    </people/prasad.illapani/blog/2005/11/14/payload-based-message-search-in-xi30-using-trex-engine> - Payload
    Based Message Search in XI30 using Trex Engine
    /people/sap.user72/blog/2005/11/24/xi-configuring-ccms-monitoring-for-xi-part-i
    </people/sap.user72/blog/2005/11/24/xi-configuring-ccms-monitoring-for-xi-part-i> - XI :
    Configuring CCMS Monitoring for XI- Part I
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    </people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter> - XI: HTML
    e-mails from the receiver mail adapter
    /people/sap.user72/blog/2005/11/22/xi-faqs-provided-by-sap-updated
    </people/sap.user72/blog/2005/11/22/xi-faqs-provided-by-sap-updated> - XI :
    FAQ's Provided by SAP
    Books from SAP PRESS...add this link to your favourites...
    http://www.sap-press.de/international?GalileoSession=97477303A3.xx-M0Y78
    Real World Scenarios of SAP XI ...VERY VERY GOOD....AWESOME
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/0
    b95b488-0701-0010-57b9-e861b1ad572f
    Check this up:
    Exchange Infrastructure How-to Guides for SAP NetWeaver 2004 [original link is broken] (how to guides)
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm (very nice XI help)
    Here is some scenarios from SDN:
    /people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters - IDoc to File
    /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy - ABAP Proxy to File
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 - File to JDBC
    /people/prateek.shah/blog/2005/06/14/file-to-r3-via-abap-proxy - File to ABAP Proxy
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1 - File to File Part 1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2 - File to File Part 2
    /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping - Any flat file to any Idoc
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit - File to RFC
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] - File to il
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address - Dynamic Mail Address
    /people/siva.maranani/blog/2005/05/25/understanding-message-flow-in-xi - Message Flow in XI
    /people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm - Walk through BPM
    /people/siva.maranani/blog/2005/05/22/schedule-your-bpm - Schedule BPM
    /people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi - Use of Synch - Asynch bridge in ccBPM
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1403 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] - Use of Synch - Asynch bridge in ccBPM
    /people/michal.krawczyk2/blog/2005/08/22/xi-maintain-rfc-destinations-centrally - Maintain RFC destination centrally
    /people/sravya.talanki2/blog/2005/08/18/triggering-e-mails-to-shared-folders-of-sap-is-u - Triggering Email from folder
    /people/sravya.talanki2/blog/2005/08/17/outbound-idocs--work-around-using-party - Handling different partners for IDoc
    /people/siva.maranani/blog/2005/08/27/modeling-integration-scenario146s-in-xi - Modeling Integration Scenario in XI
    /people/michal.krawczyk2/blog/2005/08/25/xi-sending-a-message-without-the-use-of-an-adapter-not-possible - Testing of integration process
    /people/michal.krawczyk2/blog/2005/05/25/xi-how-to-add-authorizations-to-repository-objects - Authorization in XI
    http://help.sap.com/saphelp_nw04/helpdata/en/58/d22940cbf2195de10000000a1550b0/content.htm - Authorization in XI
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step - Alert Configuration
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--troubleshooting-guide - Trouble shoot alert config
    /people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi - Call UNIX Shell Script
    /people/sravya.talanki2/blog/2005/11/02/overview-of-transition-from-dev-to-qa-in-xi - Transport in XI
    /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping - Using ABAP XSLT Extensions for XI Mapping
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure - Mail Adaptor options
    /people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm - Collection of IDoc to Single File
    /people/sap.user72/blog/2005/11/17/xi-controlling-access-to-sensitive-interfaces - Controlling access to Sensitive Interfaces
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14 - The same filename from a sender to a receiver file adapter - SP14
    /people/prasad.illapani/blog/2005/11/14/payload-based-message-search-in-xi30-using-trex-engine - Payload Based Message Search in XI30 using Trex Engine
    /people/sap.user72/blog/2005/11/24/xi-configuring-ccms-monitoring-for-xi-part-i - XI : Configuring CCMS Monitoring for XI- Part I
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter - XI: HTML e-mails from the receiver mail adapter
    /people/sap.user72/blog/2005/11/22/xi-faqs-provided-by-sap-updated - XI : FAQ's Provided by
    SAP
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6051-Performance [original link is broken] [original link is broken] [original link is broken] [original link is broken] Tuning for PI
    Please give reward points if it is useful.
    Regards,
    Sai.

  • Datasource connection with jboss, need help

    Hi friends,
    I am doing data source connection through Jboss (jboss-4.0.2) with mysql database. I am using java(j2sdk1.4.2_04). I have made all changes given in this link -- http://community.jboss.org/wiki/SetUpAMysqlDatasource
    After making changes I restart jboss properly, but when I am going to attempt to connection through class. it give following error.
    1.ERROR! Shared library ioser12 could not be found.
    Can't find SerialContextProvider
    When a create a diffrent new class, then give me this error.
    2. ERROR! Shared library ioser12 could not be found.
    Cannot get connection: javax.naming.CommunicationException: Can't find SerialContextProvider
    Kindly help me out for this problem.
    Thanks
    Abhishek Jain

    user13428037 wrote:
    ,,, JBoss ... give following error.
    1.ERROR! Shared library ioser12 could not be found.
    Can't find SerialContextProvider
    When a create a diffrent new class, then give me this error.
    2. ERROR! Shared library ioser12 could not be found.
    Cannot get connection: javax.naming.CommunicationException: Can't find SerialContextProviderPlease don't crosspost http://www.javaprogrammingforums.com/jdbc-databases/6353-datsource-connection-mysql-need-help.html#post22533
    The
    ERROR! Shared library ioser12 could not be found.error message has nothing to do with you adding a datasource.
    It would happen even before you made the datasource configuration changes.
    Looks like you added a j2ee.jar to the JBoss classpath.

  • I need Help  ( Check out cart)

    I try to develop shopping site by JSP and I need help ?
    my checkout button display jsp page include product in the cart and then insert this product in table by using anther button (valid cart)
    how can I insert item in table???
    anther queation how can I edit my cart ( like delete item or chang quentity)?
    thank you

    I try to develop shopping site by JSP and I need help
    ?Yes you need help
    >
    my checkout button display jsp page include product
    in the cart and then insert this product in table by
    using anther button (valid cart)
    how can I insert item in table???If the table you are talking about is an HTML table you need to read upon DHTML
    if the table is a DB table you will need SQL insert either through EJB or JDBC
    >
    anther queation how can I edit my cart ( like delete
    item or chang quentity)?You write a method that does whatever you want on your cart Object
    >
    thank youMy pleasure
    PS: since you question is VERY vague better help is impossible to give

  • Need help with log4j logging tool (org.apache.log4j.*) to log into database

    Hi,
    I need help with log4j logging tool (org.apache.log4j.*) to log into database using JDBCAppender. Have look at my logger code and corresponding log4j.properties file stated below. I'm running this program using Eclipse IDE and it's giving me the following error (highlighted in red) at the end:
    log4j: Parsing for [root] with value=[debug, stdout, Roll, CRSDBAPPENDER].
    log4j: Level token is [debug].
    log4j: Category root set to DEBUG
    log4j: Parsing appender named "stdout".
    log4j: Parsing layout options for "stdout".
    log4j: Setting property [conversionPattern] to [%x %d{HH:mm:ss,SSS} %5p [%t] (%c:%-4L %M) - %m%n].
    log4j: End of parsing for "stdout".
    log4j: Parsed "stdout" options.
    log4j: Parsing appender named "Roll".
    log4j: Parsing layout options for "Roll".
    log4j: Setting property [conversionPattern] to [%x %d{yyyy.MM.dd HH:mm:ss,SSS} %5p [%t] (%c:%-4L %M) - %m%n].
    log4j: End of parsing for "Roll".
    log4j: Setting property [file] to [HelloWorld.log].
    log4j: Setting property [maxBackupIndex] to [10].
    log4j: Setting property [maxFileSize] to [20KB].
    log4j: setFile called: HelloWorld.log, true
    log4j: setFile ended
    log4j: Parsed "Roll" options.
    log4j: Parsing appender named "CRSDBAPPENDER".
    {color:#ff0000}
    Can't find class HelloWorld{color}
    import org.apache.log4j.*;
    public class HelloWorld {
    static Logger log = Logger.getLogger(HelloWorld.class.getName());
    public static void main(String[] args) {
    try{
    // Now, try a few logging methods
    MDC.put("myComputerName", "Ravinder");
    MDC.put("crsServerName", "ARNDEV01");
    log.debug("Start of main()");
    log.info("Just testing a log message with priority set to INFO");
    log.warn("Just testing a log message with priority set to WARN");
    log.error("Just testing a log message with priority set to ERROR");
    log.fatal("Just testing a log message with priority set to FATAL");
    catch(Exception e){
    e.printStackTrace();
    ------------------------- log4j.properties file ------------------------------
    #### Use three appenders - log to console, file and database
    log4j.rootCategory=debug, stdout, Roll, CRSDBAPPENDER
    log4j.debug=true
    # Print only messages of priority WARN or higher for your category
    # log4j.category.your.category.name=WARN
    # Specifically inherit the priority level
    # log4j.category.your.category.name=INHERITED
    #### stdout - First appender writes to console
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%x %d{HH:mm:ss,SSS} %5p [%t] (%c:%-4L %M) - %m%n
    #### Roll - Second appender writes to a file
    log4j.appender.Roll=org.apache.log4j.RollingFileAppender
    ##log4j.appender.Roll.File=${InstanceName}.log
    log4j.appender.Roll.File=HelloWorld.log
    log4j.appender.Roll.MaxFileSize=20KB
    log4j.appender.Roll.MaxBackupIndex=10
    log4j.appender.Roll.layout=org.apache.log4j.PatternLayout
    log4j.appender.Roll.layout.ConversionPattern=%x %d{yyyy.MM.dd HH:mm:ss,SSS} %5p [%t] (%c:%-4L %M) - %m%n
    #### CRSDBAPPENDER - third appender writes to the database
    log4j.appender.CRSDBAPPENDER=org.apache.log4j.jdbc.JDBCAppender
    log4j.appender.CRSDBAPPENDER.Driver=net.sourceforge.jtds.jdbc.Driver
    log4j.appender.CRSDBAPPENDER.URL=jdbc:jtds:sqlserver:/arncorp15:1433;DatabaseName=LOG
    log4j.appender.CRSDBAPPENDER.USER=sa
    log4j.appender.CRSDBAPPENDER.PASSWORD=p8ss3doff
    log4j.appender.CRSDBAPPENDER.layout=org.apache.log4j.PatternLayout
    log4j.appender.CRSDBAPPENDER.sql=INSERT INTO LOG (computername, crsservername, logtime, loglevel, threadname, filename, linenumber, logtext) VALUES ('%X{myComputerName}', '%X{crsServerName}', '%d{dd MMM yyyy HH:mm:ss,SSS}', '%p', '%t', '%F', '%L', '%m')
    #log4j.appender.CRSDBAPPENDER.sql=INSERT INTO LOG(COMPUTERNAME,CRSSERVERNAME,LOGTIME,LOGLEVEL,THREADNAME,FILENAME,LINENUMBER,LOGTEXT) select host_name(),'${CRSServerName}${InstanceName}','%d','%5p','%t','%F','%L','%m%n'
    #log4j.appender.CRSDBAPPENDER.sql=INSERT INTO LOG (computername, crsservername, logtime, loglevel, threadname, filename, linenumber, logtext) VALUES ("%X{myComputerName}", "%X{crsServerName}", "%d{dd MMM yyyy HH:mm:ss,SSS}", "%p", "%t", "%F", "%L", "%m")
    ------------------------------- end of log4j.properties file ------------------------------
    Here is the directory structure of my program. My log4j.properties file and HelloWorld.class file are residing in folder HelloWorld\bin.
    HelloWorld\bin
    HelloWorld\lib
    HelloWorld\src
    Please note - The same program works fine for console and file appender when I comment the database appender part in my properties file.
    Thanks
    Ravinder

    try this :
    log4j.appender.PROJECT.Append=false

  • Need help regarding query

    dear all,
    i am working with JDBC and Access database. I have a table name FilingTable and it has 6 column: title, mdate, tdate, place, content and person. the UI has a jdbtable where it shows all the data from the database. there are six textfield where i can give value seach for perticular row consisting this value. the quirement is : I may give a parameter, two parameter and may be six parameter the search will show the rows containing those value or closely similar to those value. I need help from you.
    zakir

    Hello,
    Try SQL with the LIKE condition to perform your search and % as wildcards.
    LIKE will however not find similar matches but only exact matches.
    Hope this helps
    Niklas

  • Please, please  -  i need help urgent.

    hi,
    i have a problem over 3 days and i cant find what is wrong.
    i'm using jbuilder and with him evruthing is ok, but when i want to work with tomcat something going not good and i dont know what.
    all the time i'm getting this exception:
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
         org.apache.jsp.main_jsp._jspService(org.apache.jsp.main_jsp:300)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
         sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
         sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
         sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
         sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
         sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
         java.sql.DriverManager.getConnection(Unknown Source)
         java.sql.DriverManager.getConnection(Unknown Source)
         cellcom_1.DBConnection.DBConnection.<init>(DBConnection.java:29)
         org.apache.jsp.main_jsp._jspService(org.apache.jsp.main_jsp:63)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
    i checked my database configuration and its seems that it ok(and its run with jbuilder ok).
    i need help, please!!!

    Pray tell me where in teh server.xml/context.xml will you need to >configure a datasource for a simple bridge-driver program as is >obvious from teh stack trace? gcrashed,
    When a datasource is used, the connections are retrieved from the datasource. The datasource maintains a pool of connections which can be configured. Programs can retrieve the connections from the datasource and after usage, they are returned to the datasource. Since it is the server that maintains the datasource, properties like connection info, max number of connections etc have to be configured in the server.xml or context.xml
    And here is the relevant documentation in tomcat on how to set up a datasource - http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html
    Setting up a datasource in tomcat requires configuring them in server.xml (for global resources) or in context.xml (for a datasource resource local to your web application).
    Here is a thread which describes in detail the process of setting it up - http://forum.java.sun.com/thread.jspa?threadID=643344
    Now there are several issues setting up a tomcat datasource, especially for first time users. See the forum thread above for one such discussion.
    What configuration is required in tomcat when the stack trace so >clearly shows that he is using the sun.jdbc.odbc.JdbcOdbcDriver and >so obviously using a dsn name for his connection??????As I said earlier, you are missing the point. The OP is not trying to create a connection directly from his program. Or by datasource, he does not mean the microsoft user-dsn datasource that I think you are reffering to. Once again, please read the tomcat link above on what a jndi-jdbc datasource means
    Please give me the all 10 different issues that would produce the same stack trace.I was infact hoping somebody would ask. Just type the error stack trace in google, this forum or javaranch or theserverside.com and you would find tons of posts on setting up a jndi datasource and the issues people faced therein.
    that's the first and easiest suggestion to give. you don't need to give that suggestion here. Its an open forum. Nobody can tell anybody else on what he/she ought to post. If you dont like it, ignore it. But wait, that's an easy answer. And Iam not going to take that stand. I stick to my opinion that asking the OP to read the docs is still the best suggestion in the post. The OP's problems combined with his comments that the db is working fine suggest a serious lack of understanding of the way datasource and connection pooling works with tomcat.
    yes, if the problem is absolutely trivial like: how do i set up a connection using DriverManager - yes u can say - go read the docs. i can swear one can find the answers for half (or many more than that) problems posted in any forum in the documentation. but the fact is that many people do a fair amnount of hunting thru the docs and turn to a forum as a last resort. but they always miss something coz it's very natural. If you would search this forum and analyse duffy's or anybody else( who is a regular in this forum) previous posts, you would find that they have a pretty impeccable record of helping people with genuine problems when they know that the poster has taken some pains or effort to get it going by him/her self. They even hand hold people if the concept is a difficult one or if its one they find stiumlating/challenging.
    But this 'unable to set up a datsource' thinggy has been asked and answered a thousand times in this forum and many more in several other forums and all the OP had to do was just search. To be fair, the OP may not have been aware of this fact as he is coming up against this the first time, which's why I maintain, read the docs or search the forum is a suggestion that ought to be taken seriously (rather than being thought of as rude or condescending).
    If my comments seemed harsh, i apologize.Make that two. Its not my intention either to brow-beat or be harsh. I am just explaining why I took duffy's side, case in point. No offence intended.
    cheers,
    ram.

  • Need help determining compiling error

    Good morning,
    I need help finding the cause of a compiling error I receive. I have reviewed my code numerous times without any luck. I hope you guys might see something I am not! The entire file exceeds the limit I can post, so I am attaching it in 2 posts. Sorry for the inconvenience. The error and my code are posted below. Thank you for your help!
    C:\StockTrackerDB.java:382: cannot find symbol
    symbol : method add(java.lang.Boolean)
    location: class java.util.ArrayList<java.lang.String>
                   aList.add(new Boolean(rs.getBoolean("admin")));
    ^
    1 error
    Tool completed with exit code 1
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class StockTrackerDB
         private Connection con = null;
         //Constructor; makes database connection
         public StockTrackerDB() throws ClassNotFoundException,SQLException
              if(con == null)
                   String url = "jdbc:odbc:StockTracker";
                   try
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   catch(ClassNotFoundException ex)
                        throw new ClassNotFoundException(ex.getMessage() +
                                    "\nCannot locate sun.jdbc.odbc.JdbcOdbcDriver");
                   try
                        con = DriverManager.getConnection(url);
                   catch(SQLException ex)
                        throw new SQLException(ex.getMessage()+
                                    "\nCannot open database connection for "+url);
         // Close makes database connection; null reference to connection
         public void close() throws SQLException,IOException,ClassNotFoundException
              con.close();
              con = null;
         // Method to serialize object to byte array
         private byte[] serializeObj(Object obj) throws IOException
              ByteArrayOutputStream baOStream = new ByteArrayOutputStream();
              ObjectOutputStream objOStream = new ObjectOutputStream(baOStream);
              objOStream.writeObject(obj); // object must be Serializable
              objOStream.flush();
              objOStream.close();
              return baOStream.toByteArray(); // returns stream as byte array
         // Method to deserialize bytes from a byte array into an object
         private Object deserializeObj(byte[] buf) throws IOException, ClassNotFoundException
              Object obj = null;
              if(buf != null)
                   ObjectInputStream objIStream = new ObjectInputStream(new ByteArrayInputStream(buf));
                   obj = objIStream.readObject(); //IOException, ClassNotFoundException
              return obj;
         // Methods for adding a record to a table
         // add to the Stocks Table
         public void addStock(String stockSymbol, String stockDesc) throws SQLException, IOException, ClassNotFoundException
              Statement stmt = con.createStatement();
              stmt.executeUpdate("INSERT INTO Stocks VALUES ('"
                                    +stockSymbol+"'"
                                    +",'"+stockDesc+"')");
              stmt.close();
         // add to the Users table
         public boolean addUser(User user) throws SQLException,IOException,ClassNotFoundException
              boolean result = false;
              String dbUserID;
              String dbLastName;
              String dbFirstName;
              Password dbPswd;
              boolean isAdmin;
              dbUserID = user.getUserID();
              if(getUser(dbUserID) == null)
                   dbLastName = user.getLastName();
                   dbFirstName = user.getFirstName();
                   Password pswd = user.getPassword();
                   isAdmin = user.isAdmin();
                   PreparedStatement pStmt = con.prepareStatement("INSERT INTO Users VALUES (?,?,?,?,?)");
                   pStmt.setString(1, dbUserID);
                   pStmt.setString(2, dbLastName);
                   pStmt.setString(3, dbFirstName);
                   pStmt.setBytes(4, serializeObj(pswd));
                   pStmt.setBoolean(5, isAdmin);
                   pStmt.executeUpdate();
                   pStmt.close();
                   result = true;
              else
                   throw new IOException("User exists - cannot add.");
              return result;
         // add to the UserStocks table
         public void addUserStocks(String userID, String stockSymbol)
                        throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              stmt.executeUpdate("INSERT INTO UserStocks VALUES ('"
                                    +userID+"'"
                                    +",'"+stockSymbol+"')");
              stmt.close();
         // Methods for updating a record in a table
         // updating the Users table
         public boolean updUser(User user) throws SQLException, IOException, ClassNotFoundException
              boolean result = false;
              String dbUserID;
              String dbLastName;
              String dbFirstName;
              Password dbPswd;
              boolean isAdmin;
              dbUserID = user.getUserID();
              if(getUser(dbUserID) != null)
                   dbLastName = user.getLastName();
                   dbFirstName = user.getFirstName();
                   Password pswd = user.getPassword();
                   isAdmin = user.isAdmin();
                   PreparedStatement pStmt = con.prepareStatement("UPDATE Users SET lastName = ?," + " firstName = ?, pswd = ?, admin = ? WHERE userID = ?");
                   pStmt.setString(1, dbLastName);
                   pStmt.setString(2, dbFirstName);
                   pStmt.setBytes(3, serializeObj(pswd));
                   pStmt.setBoolean(4, isAdmin);
                   pStmt.setString(5, dbUserID);
                   pStmt.executeUpdate();
                   pStmt.close();
                   result = true;
              else
                   throw new IOException("User does not exist - cannot update.");
              return result;
         }

         // Methods for deleting a record from a table
         // delete a record from the Stocks table
         private void delStock(String stockSymbol) throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              stmt.executeUpdate("DELETE FROM Stocks WHERE "
                                    +"symbol = '"+stockSymbol+"'");
              stmt.close();
         // delete a record from the Users table
         public void delUser(User user) throws SQLException,IOException,ClassNotFoundException
              String dbUserID;
              String stockSymbol;
              Statement stmt = con.createStatement();
              try
                   con.setAutoCommit(false);
                   dbUserID = user.getUserID();
                   if(getUser(dbUserID) != null) // verify user exists in database
                        ResultSet rs1 = stmt.executeQuery("SELECT userID, symbol "
                                              +"FROM UserStocks WHERE userID = '"+dbUserID+"'");
                        while(rs1.next())
                             try
                                  stockSymbol = rs1.getString("symbol");
                                  delUserStocks(dbUserID, stockSymbol);
                             catch(SQLException ex)
                                  throw new SQLException("Deletion of user stock holding failed: " +ex.getMessage());
                        } // end of loop thru UserStocks
                        try
                        {  // holdings deleted, now delete user
                             stmt.executeUpdate("DELETE FROM Users WHERE "
                                              +"userID = '"+dbUserID+"'");
                        catch(SQLException ex)
                             throw new SQLException("User deletion failed: "+ex.getMessage());
                   else
                        throw new IOException("User not found in database - cannot delete.");
                   try
                        con.commit();
                   catch(SQLException ex)
                        throw new SQLException("Transaction commit failed: "+ex.getMessage());
              catch (SQLException ex)
                   try
                        con.rollback();
                   catch (SQLException sqx)
                        throw new SQLException("Transaction failed then rollback failed: " +sqx.getMessage());
                   // Transaction failed, was rolled back
                   throw new SQLException("Transaction failed; was rolled back: " +ex.getMessage());
              stmt.close();
         // delete a record from the UserStocks table
         public void delUserStocks(String userID, String stockSymbol) throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              ResultSet rs;
              stmt.executeUpdate("DELETE FROM UserStocks WHERE "
                                    +"userID = '"+userID+"'"
                                    +"AND symbol = '"+stockSymbol+"'");
              rs = stmt.executeQuery("SELECT symbol FROM UserStocks "
                                         +"WHERE symbol = '"+stockSymbol+"'");
              if(!rs.next()) // no users have this stock
                   delStock(stockSymbol);
              stmt.close();
         // Methods for listing record data from a table
         // Ordered by:
         //          methods that obtain individual field(s),
         //          methods that obtain a complete record, and
         //          methods that obtain multiple records
         // Methods to access one or more individual fields
         // get a stock description from the Stocks table
         public String getStockDesc(String stockSymbol) throws SQLException, IOException, ClassNotFoundException
              Statement stmt = con.createStatement();
              String stockDesc = null;
              ResultSet rs = stmt.executeQuery("SELECT symbol, name FROM Stocks "
                                                      +"WHERE symbol = '"+stockSymbol+"'");
              if(rs.next())
                   stockDesc = rs.getString("name");
              rs.close();
              stmt.close();
              return stockDesc;
         // Methods to access a complete record
         // get User data from the Users table
         public User getUser(String userID) throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              String dbUserID;
              String dbLastName;
              String dbFirstName;
              Password dbPswd;
              boolean isAdmin;
              byte[] buf = null;
              User user = null;
              ResultSet rs = stmt.executeQuery("SELECT * FROM Users WHERE userID = '" +userID+"'");
              if(rs.next())
                   dbUserID = rs.getString("userID");
                   dbLastName = rs.getString("lastName");
                   dbFirstName = rs.getString("firstName");
                   // Do NOT use with JDK 1.2.2 using JDBC-ODBC bridge as
                   // SQL NULL data value is not handled correctly.
                   buf = rs.getBytes("pswd");
                   dbPswd=(Password)deserializeObj(buf);
                   isAdmin = rs.getBoolean("admin");
                   user = new User(dbUserID,dbFirstName,dbLastName,dbPswd,isAdmin);
              rs.close();
              stmt.close();
              return user; // User object created for userID
         // Methods to access a list of records
         // get a list of selected fields for all records from the Users Table
         public ArrayList listUsers() throws SQLException,IOException,ClassNotFoundException
              ArrayList<String> aList = new ArrayList<String>();
              Statement stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery("SELECT userID, firstName, lastName, admin "
                                                 +"FROM Users ORDER BY userID");
              while(rs.next())
                   aList.add(rs.getString("userID"));
                   aList.add(rs.getString("firstName"));
                   aList.add(rs.getString("lastName"));
                   aList.add(new Boolean(rs.getBoolean("admin")));
              rs.close();
              stmt.close();
              return aList;
         // get all fields in all records for a given user from the UserStocks table
         public ArrayList listUserStocks(String userID) throws SQLException, IOException, ClassNotFoundException
              ArrayList<String> aList = new ArrayList<String>();
              Statement stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery("SELECT * FROM UserStocks "
                                                      +"WHERE userID = '"+userID+"' ORDER BY symbol");
              while(rs.next())
                   aList.add(rs.getString("symbol"));
              rs.close();
              stmt.close();
              return aList;
    }

  • Need Help Using JTA / Tyrex

    I am unable to find any sample code for using Tyrex's Transaction Manager and the JTA API. Can anyone help me here? There are a few things I need help with, but if you can help me on any of them that would be huge!
    1. Setting up / Configuring Tyrex
    2. Adding MS SQL as DataSource (and Transaction Domain? It's not clear what that means exactly) (I have the beta JDBC driver from MS)
    3. Writing Code to execute a DB statement inside a transaction
    4. Writing Code to make an object I create participate in a transaction, i.e. you can rollback setting something on my object. e.g. if you an object MyObject had a default "age" of 10 and you called MyObject.setAge( 25 ); and then called trans.rollback(); and then MyObject.getAge() it would return 10.
    I looked on Java.sun.com for some info on using transactions but it appears that they do NOT want to promote Java developers learning the transaction API in that depth. Rather, they'd prefer that you only use the JTA as a client, e.g. through EJB Containers. Does anyone know of some tutorials or something on this stuff any where? I want to write my own transactionable objects/system but there's almost no info anywhere. And Tyrex's website has next to nothing in help too!
    - Robert

    There's been several discussions on the tomcat-user mailing list mentioning Tyrex recently. I have no idea if they're relevant to you, but I remember seeing them go by and wondering what the $#$%)(%^ Tyrex was... <grin>
    You can search the list archives at http://marc.theaimsgroup.com/?l=tomcat-user&r=1&w=2

Maybe you are looking for

  • Camera Roll to iCloud. How does this work?

    I need help with my photos on camera roll. I need to delete them to have more space on my phone to take more. I want to be able to keep the pics in my camera roll though. I have iCloud and a bunch of space on there. How do I know for sure that the pi

  • Unable to install security updates via WSUS on Windows 2008 client servers

    When I try install to install updates on Windows 2008 client servers I get the error : Code 80244019  Windows Update encountered an unknown error After running the WSUS Client Diagnostic Tool I get the result : GetFileVersion(szEngineDir,&susVersion)

  • How to change lid closing setting for Satellite A660

    How do I "dock" my laptop? I.e. I wish to use a monitor via HDMI and I need to close the lid to laptop. How do I do that without automatically turning it off ? Thank you.

  • File to File interface Count

    HI ALL, I have a file to file scenario used to move 100 PDF files from System A to B . i give wildcard * in the sender communication and used ASMA to name the file in the receiver side. the requirment is client is asking to send a e-mail aftre sendin

  • Condition type restriction

    Hello Sap Guru's, In the scenario, how to restrict condition type for manual entries to a particular user? Regards, JP