Help me running CryptoTest example

Hi there..
I need a help with CryptoTest example. It can be found here: http://java.sun.com/developer/J2METechTips/2001/tt1217.html
I�m using J2ME WTK 2.2 + patch.
What should i do to build it?
At least, could anybody tell me a good tutorial that teaches how to use differents libs?
Thanks so much..
The source is it:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.rms.*;
import org.bouncycastle.crypto.*;
// Simple test of encryption/decryption routines.
public class CryptoTest extends MIDlet {
    private Display display;
    private Command exitCommand =
                         new Command( "Exit",
                                     Command.EXIT, 1 );
    private Command okCommand =
                         new Command( "OK",
                                      Command.OK, 1 );
    private Encryptor   encryptor;
    private RecordStore rs;
    public CryptoTest(){
    protected void destroyApp( boolean unconditional )
                   throws MIDletStateChangeException {
        exitMIDlet();
    protected void pauseApp(){
    protected void startApp()
                   throws MIDletStateChangeException {
        if( display == null ){ // first time called...
            initMIDlet();
    private void initMIDlet(){
        display = Display.getDisplay( this );
        // Open a record store here
        try {
            rs = RecordStore.openRecordStore( "test",
                                    true );
        catch( RecordStoreException e ){
            // put in error handling here
        display.setCurrent( new AskForKey() );
    public void exitMIDlet(){
        try {
            if( rs != null ){
                rs.closeRecordStore();
        catch( RecordStoreException e ){
        notifyDestroyed();
    private void displayException( Exception e ){
        Alert a = new Alert( "Exception" );
        a.setString( e.toString() );
        a.setTimeout( Alert.FOREVER );
        display.setCurrent( a, new AskForKey() );
    class AskForKey extends TextBox
                    implements CommandListener {
        public AskForKey(){
            super( "Enter a secret key:", "", 8, 0 );
            setCommandListener( this );
            addCommand( okCommand );
            addCommand( exitCommand );
        public void commandAction( Command c,
                                   Displayable d ){
            if( c == exitCommand ){
                exitMIDlet();
            String key = getString();
            if( key.length() < 8 ){
                Alert a = new Alert( "Key too short" );
                a.setString( "The key must be " +
                             "8 characters long" );
                setString( "" );
                display.setCurrent( a, this );
                return;
            encryptor = new Encryptor( key );
            try {
                if( rs.getNextRecordID() == 1 ){
                    display.setCurrent(
                                  new EnterMessage() );
                } else {
                    byte[] data = rs.getRecord( 1 );
                    String str =
                       encryptor.decryptString( data );
                    Alert a =
                        new Alert( "Decryption" );
                    a.setTimeout( Alert.FOREVER );
                    a.setString(
                        "The decrypted string is '" +
                                 str + "'" );
                    display.setCurrent( a, this );
            catch( RecordStoreException e ){
                displayException( e );
            catch( CryptoException e ){
                displayException( e );
    class EnterMessage extends TextBox
                       implements CommandListener {
        public EnterMessage(){
            super( "Enter a message to encrypt:", "",
                   100, 0 );
            setCommandListener( this );
            addCommand( okCommand );
        public void commandAction( Command c,
                                   Displayable d ){
            String msg = getString();
            try {
                byte[] data =
                      encryptor.encryptString( msg );
                rs.addRecord( data, 0, data.length );
            catch( RecordStoreException e ){
                displayException( e );
            catch( CryptoException e ){
                displayException( e );
            display.setCurrent( new AskForKey() );
}Message was edited by:
eduardoll

Could you try the following command:
asadmin user <username> password <password> deploydir c:\Sun\AppServer\samples\quickstart\build
where you replace <username> and <password> with the appropriate values for your setup. As noted in the quick start guide you do not have to provide the user and password options if you used the "Don't Prompt" option when installing the app server.

Similar Messages

  • Running VC example applications

    I'm trying to learn VC with the examples provided by VC Modeling Resource Center (Visual Composer Modeling Resource Center [original link is broken]).
    I downloaded an example and it comes with two files (gml and sql). I tried to follow the tutorial "How to run VC applications" (https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60e62459-7975-2910-64a2-8a61b0c83208) but on beggining of tutorial says about SQL Server Enterprise Manager. Isn't that a Microsoft apllication ? I dont have that software because my server is Unix. So the begging of that tutorial don't work for me.
    Can anyone help me please ?
    Thanks

    Hi Vitor,
    I'm afraid you need an SQL DB in order to run this example.
    You can find good examples for learning Visual Composer (using R3 or BI systems) in the Modeler's guide - https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/63f2052e-0c01-0010-b9a2-e1f7457a7fbe - in the "Go and Create" chapter.
    Good Luck,
    Dafna

  • Help with running multiple threads

    I'm new to programming with threads. I want to know how to run
    multiple threads at the same time. Particularly for making games
    in Java which I'm also begining to learn. For running multiple
    threads at the same time, do you have to put two run() methods
    in the source? If not then how do you make two threads or more
    run at the same time?
    Thanks for helping.

    For running multiple
    threads at the same time, do you have to put two run()
    methods
    in the source? Hi there,
    Each thread is presumably performing a task. You may be performing the same task multiple times or be performing different tasks at once. Either way, each task would typically be contained within the run() method of a class. This class would either be a subclass of java.lang.Thread (extends Thread) or would be an implementation of java.lang.Runnable (implements Runnable). In either case, you would define a method with signature (public void run()...). The difference comes into play when you wish to actually perform one of these tasks. With a subclass of Thread, you would simply perform:
    new MyTask().start();
    With an implementation of Runnable, you would do this:
    new Thread(new MyTask()).start();
    This assumes you don't need to monitor the threads, won't be sending any messages to your tasks or any such thing. If that were the case, you would need to tuck away those returns to new MyTask() for later access.
    In order to launch two threads simultaneously, you would have something along the lines of:
    new MyTask().start();
    new MyOtherTask().start();
    Now it is perfectly possible that MyTask() would complete before MyOtherTask() managed to start in which case it wouldn't appear as if you had actually had multiple threads running, but for non-trivial tasks, the two will likely overlap. And of course, in a game, these tasks would likely be launched in response to user input, which means that you wouldn't have any control over when or in what order they executed.
    Anyhow, it's as simple as that. You should also consider following the Java Threading trail which shows a simple example of using multiple threads. You can find it at:
    http://java.sun.com/docs/books/tutorial/essential/threads/index.html
    Regards,
    Lynn

  • Trying to run the example "rf record and playback reference application"

    http://zone.ni.com/devzone/cda/epd/p/id/5894   trying to run this example but a lot of files are not being found.  I'm using Labview 8.5 with version 4 of the sound and vibration toolkit.  I suspect the problem is the old toolkit version.  Can someone confirm? Can't find any info on upgrading to toolkit so I suppose it would mean a new purchase?  thanks

    Hello Mike,
    This example is designed for our RF Hardware platform.  You need the RFSG driver, RFSA driver, Spectral Measurements Toolkit, Modulation Toolkit, and the advanced signal processing toolkit for the example to run.  You should be able to see this under the software requirements at the bottom of the page.  The two drivers should be available for download on our website, but the toolkits must be purchased and they aren't generally available with the dev suite.
    I hope this helps,
    Paul C
    Message Edited by Paul C. on 03-11-2010 12:28 PM

  • Running insurance example error !

    Running insurance example error !
    I used Oracle9i, ifs9, windows2000.
    I already complied *.java, and place them in cusstom_class directory.
    Place *.jsp in ifs/jsp-bin directory
    Upload *.xml to ifs server.
    But when i open browser with URI:/ifs/files/ifs/jsp-bin/login.jsp, it's error:
    JSP Error:
    Request URI:/ifs/files/ifs/jsp-bin/login.jsp
    Exception:
    oracle.jsp.parse.JspParseException: Line # 6,
    Error: Unable to find class for bean: inslogin defined by tag with class: oracle.ifs.examples.jspapps.insurance.InsuranceLogin
         at oracle.jsp.parse.OpenJspTagHandler.defineBeans(OpenJspTagHandler.java, Compiled Code)
         at oracle.jsp.parse.OpenJspTagHandler.validateTagAttributes(OpenJspTagHandler.java, Compiled Code)
         at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java, Compiled Code)
         at oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java)
         at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java, Compiled Code)
         at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java, Compiled Code)
         at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java)
         at oracle.jsp.app.JspAppLoader.reloadPage(JspAppLoader.java)
         at oracle.jsp.app.JspAppLoader.loadPage(JspAppLoader.java)
         at oracle.jsp.app.JspAppLoader.getPage(JspAppLoader.java)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java)
         at oracle.jsp.JspServlet.internalService(JspServlet.java, Compiled Code)
         at oracle.ifs.protocols.dav.impl.IfsDavServlet.processJsp(IfsDavServlet.java:2591)
         at oracle.ifs.protocols.dav.impl.IfsDavServlet.doGet(IfsDavServlet.java:855)
         at oracle.ifs.protocols.dav.DavServlet.processRequest(DavServlet.java, Compiled Code)
         at oracle.ifs.protocols.dav.DavServlet.service(DavServlet.java:2177)
         at oracle.ifs.protocols.dav.impl.IfsDavServlet.service(IfsDavServlet.java:497)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
         at org.apache.jserv.JServConnection.run(JServConnection.java:188)
         at java.lang.Thread.run(Thread.java:479)
    Someone help me!
    Thanks alot.

    It may your CLASSPATH environment variable - what that is saying is it can't find a referenced class. You'll need to make sure that all required classes are made. I'd opt for using a java ide for developing as it handles all that stuff for you.

  • Running weblogic examples and Jms configuration

    I am new to JMS. I configured the JMS server using the weblogic console page and i created JMS server under Services. I am having only one server. I am starting the console using http://localhost:7001/
              Now i want to run the examples of weblogic (QueueSend.java and QueueReceive.java).
              What are the changes i have to do in the given java files and how to run the examples.
              Please give the steps to configure JMS server and run the example and what are the parameters i have to pass to these file?
              Thank you

    Hello,
              I am having problem with WL. I use version 8.1 with multiple server.
              The Admin server works fine, but when I try to start other servers, I am getting the following errors.
              Aug 23, 2005 2:48:16 PM EDT> <Error> <NodeManager@*.*:5555> <SocketInputHandler: Command read failed 'Read channel closed.' on socket /127.0.0.1>
              <Aug 23, 2005 2:48:16 PM EDT> <Error> <NodeManager@*.*:5555> <Failed to write to socket Read channel closed., to /127.0.0.1>
              <Aug 23, 2005 2:48:16 PM EDT> <Error> <NodeManager@*.*:5555> <Failed to write to socket Write Channel Closed, possible SSL handshaking or trust failure, to /127.0.0.1>
              <Aug 23, 2005 2:48:20 PM EDT> <Info> <NodeManager@*.*:5555> <Starting Server devDomain::buyerserver1 ...>
              <Aug 23, 2005 2:48:21 PM EDT> <Info> <NodeManager@*.*:5555> <Server devDomain::buyerserver1 started, process id = 4,068>
              <Aug 23, 2005 2:49:33 PM EDT> <Info> <NodeManager@*.*:5555> <__COMMAND_DONE__>
              Can someone please help?
              Thank you.

  • Problem running your example with TCL in TestStand 2.0

    I`m having problems trying to run your example: "Calling TCL Scripts from TestStand 1.0.x". I use TestStand 2.0. In fact, I don`t see any response when running first step in a sequence. Could it be issues related to the TestStand version.

    The example should work in TestStand 2.0.x, since other users have reported that they have successfully done so and nothing has changed in TestStand 2.0.x that would affect its execution.
    In order to get the example to work you will need to have the TCL interpreter installed correctly so that the dll being used in the example can invoke it. If you can programmatically control the interpreter with any other code module as this dll does then this example should work as well. However, if you cannot do this in any way on your system then it is safe to say that nothing will work including the example. Verify that the TCL interpreter will work in this fashion per the vendor's instructions and then try the example again. If you are receiving errors from TestStand
    when executing the sequence let us know about those and we may be able to help you more directly.
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • Run the example of ejb tutorial ...

    When I run the example of "Enterprise JavaBeansTM Tutorial:
    Building Your First Stateless Session Bean"--DemoClient,(Weblogic server 6.0,
    win 2000) ,I met a probelm.
    Following is the error information:
    C:\bea\wlserver6.0\CLASSES>java -Djava.naming.factory.initial=weblogic.jndi.Teng
    ahInitialContextFactory -Djava.naming.provider.url=t3://localhost:7001 ejb.demo.
    DemoClient
    begin DemoClient...
    => Error <=
    javax.naming.NoInitialContextException: Cannot instantiate class: weglogic.jndi.
    T3InitialContextFactory. Root exception is java.lang.ClassNotFoundException: we
    glogic.jndi.T3InitialContextFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:195)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.jav
    a:45)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    55)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
    at javax.naming.InitialContext.init(InitialContext.java:222)
    at javax.naming.InitialContext.<init>(InitialContext.java:198)
    at ejb.demo.DemoClient.getInitialContext(DemoClient.java:58)
    at ejb.demo.DemoClient.main(DemoClient.java:15)
    End DemoClient...
    Any guidance will be appreciated!
    Thanks, Yu

    I managed to fix my problem, hopefully thissolution
    will help you as well.
    I discovered that the following entries arerequired
    in the jndi.properties file in order to lookupEJB's
    using JNDI from a client application:
    java.naming.factory.initial=com.sun.jndi.cosnaming.CNCt
    Factory
    java.naming.provider.url=iiop://localhost:1050
    Note that my environment uses the j2ee server fromSUN
    running on the localhost on port 1050.
    If you can locate the proper settings for theweblogic
    server, then you can try this solution on for size.
    One quick question: When I try to run my client
    against the Ref. Implementation like this:
    java -Dorg.omg.CORBA.ORBInitialHost=localhost
    -Dorg.omg.CORBA.ORBInitialPort=1050
    -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CN
    txFactory
    -Djava.naming.provider.url=iiop://localhost:1050
    com.sld.role.ValidationClient
    I get the following error:
    javax.naming.NamingException: java:comp/env namespace
    is only available from within a J2EE component.
    This stinks. All I can find out is that Sun wants you
    to use runclient, which is silly. My client is trying
    to resolve the JNDI name:
    "java:comp/env/ejb/ValidationSessionBean"
    Any idea why this isn't working?
    Thanks....
    -ScottGot it working. Here's how:
    In the client's CLASSPATH I have three things: j2ee.jar, the client jar file generated by the server during deployment, and my client class files. I took out all of the -D stuff above and it still works. (With or without it.) I haven't tried it from another machine yet - I may need them for that.
    The client uses the JNDI name "ValidationSessionBean", not "java:comp/env/ejb/ValidationSessionBean" and it now can bind to it.
    I wish Sun would have given out this kind of info with their J2EE tutorial, instead of just pushing their runclient script, which uses their own client class.
    -Scott

  • How can i run the example programme without hardware

    Hi,
         We are using NI-9233 for our Project. We would like to run the example programme, the NI-9233 getting started(host).vi ... I would like to ask that how can i run the Programme without Hardware.& How shall i get the input signal (simulating signal)?because we would like to test it while we are waiting for the hardware to be delivered . 
    thanks
    Best regards

    As Mike indicated , " you can use MAX to simulate some (not all) DAQmx devices. There's a NI-USB-9233 device that you can probably use. Open MAX, then expand "My System", the expand "Devices and Interfaces", then right-click on "NI-DAQmx Devices" and select "Create New NI-DAQmx Device -> NI-DAQmx Simulated Device". Select the device from the list. See the online help for MAX for further help.
    If you don't see "NI-DAQmx Devices" in MAX you need to install NI-DAQmx. You can download it from NI here. "
    hi,
         the link you gave me to download is "NI-DAQmx Devices" ... There is no software to download for Labview 8.2.1. So should i use 8.1 or 8.3 instead of 8.2.1 ? If not, can you tell me the CD no. that includes the "NI-DAQmx Devices" folder of Labview 8.2.1 version? Because we can get the cd from our school's component store. Thank you so much.
    Best Regards,
    Su

  • I need help to run this package and i got some error

    create or replace
    PACKAGE BODY SUBS_INS_API_sun
    AS
    PROCEDURE SUBSCRIBER_INS_sun
        (SOURCE_SYS_ID IN VARCHAR2,
        TRACKING_ID IN VARCHAR2,
        ACCOUNT_NO IN VARCHAR2,
        prepaidActDevDetails_tab IN prepaidactdvcdetailsobj_sun,
        ERROR_CODE OUT VARCHAR2)
    IS
    Input_Parameter_Is_Null EXCEPTION;
    pragma exception_init(Input_Parameter_Is_Null,-2000);
    prepaidAccountDetails prepaidActDevDetails_tab:= prepaidActDevDetails_tab(NULL,NULL,NULL,NULL,NULL);
    STATUS VARCHAR2(1):='1';
    cust_no VARCHAR(10);
    m_mac_id VARCHAR2(20);
      subscriber_master_Rec subscriber_master%ROWTYPE                 :=NULL;
      flg NUMBER(1);
    BEGIN
       IF(Source_Sys_Id IS NULL OR Tracking_Id IS NULL OR ACCOUNT_NO IS NULL OR prepaidAccountDetails.LAST=0) THEN
        RAISE Input_Parameter_Is_Null;
      END IF;
      BEGIN
             select cm_cust_no into cust_no from customer_master where cm_cust_id=ACCOUNT_NO and cm_status in('A','P','0');
          EXCEPTION
          WHEN NO_DATA_FOUND THEN
            DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
                   STATUS:='0';
        END;
      BEGIN
         FOR i IN prepaidAccountDetails.FIRST .. (prepaidAccountDetails.LAST) LOOP
         prepaidAccountDetails1:=prepaidActDevDetails_tab(i);
         prepaidAccountDetails1.Status_of_device:='1';
         IF (prepaidAccountDetails.Account_id is NULL OR prepaidAccountDetails.Mac_Id is NULL or prepaidAccountDetails.LOB_value is NULL) THEN
          RAISE Input_Parameter_Is_Null;
                END IF;
                IF(prepaidAccountDetails.LOB_value = 'VDO') THEN
                 IF(prepaidAccountDetails.Channel_Line_Up is NULL) THEN
                  Error_code :='SI002';
                 DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
                 STATUS:=0;
                  prepaidAccountDetails.Status_of_device:='0';
                 END IF;
                END IF;
                begin
                   select 1 into flg from subscriber_master where pm_phone_no=prepaidAccountDetails.Mac_Id and pm_status in('P','0','A','B');
                EXCEPTION
                 WHEN NO_DATA_FOUND THEN
                  flg:=0;
                 END;
                 if(flg=1) then
                  DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
                  STATUS:=0;
                  prepaidAccountDetails.Status_of_device:='0';
                 END IF;
                 begin
                  select md_mac_id into m_mac_id from mac_details where md_mac_id=prepaidAccountDetails.Mac_Id and md_start_date<=sysdate
                  and md_status='A';
                EXCEPTION when OTHERS then
                  Error_code :='SI004';
                 DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
                  STATUS:=0;
                  prepaidAccountDetails.Status_of_device:='0';
                 end;
              if(STATUS= 1 and prepaidAccountDetails.Status_of_device='1') then
               SELECT PM_SUBS_ACT_NO_SEQ.nextval
               INTO subscriber_master_rec.PM_SUBS_ACT_NO
               FROM dual;
              subscriber_master_Rec.pm_phone_no          :=prepaidAccountDetails.Mac_Id;
            subscriber_master_Rec.pm_open_date         :=sysdate;
              subscriber_master_rec.pm_status            :='P';
              subscriber_master_rec.PM_CUST_LVL_YN:='S';
             subscriber_master_rec.PM_EQUP_CODE:=prepaidAccountDetails.LOB_value;
             subscriber_master_rec.PM_HOME_AREA:='HOM';
             subscriber_master_rec.PM_USG_CODE:='USG';
             subscriber_master_rec.PM_NO_TYPE:='S';
             subscriber_master_rec.PM_TCG_CODE:='DEF';
             subscriber_master_rec.PM_APLN_DATE:=sysdate;
              subscriber_master_rec.PM_USER2:=prepaidAccountDetails.LOB_value;
              subscriber_master_rec.PM_USER3:=prepaidAccountDetails.Channel_Line_Up;
              subscriber_master_rec.pm_cust_no:=cust_no;
              INSERT INTO subscriber_master VALUES subscriber_master_rec;
            END IF;
         END LOOP;
        END;
      END SUBSCRIBER_INS_sun;
    END SUBS_INS_API_sun;
    and
    i got this error
    Package Body PREPAID_TESTNEW.SUBS_INS_API@PREPAID_TESTNEW
    Error(73,4): PL/SQL: Statement ignored
    Error(73,99): PLS-00302: component 'LAST' must be declared
    Error(87,6): PL/SQL: Statement ignored
    Error(87,37): PLS-00302: component 'FIRST' must be declared
    please help to run this package if anyone knows

    now i corrected my package. It working fine. But, how to run this package via procedure. my procedure check below. I give all the details about my package check below.
    ---pkg specification
    create or replace
    PACKAGE SUBS_INS_API_SS
    IS
    PROCEDURE SUBSCRIBER_INS_SS
        (SOURCE_SYS_ID IN VARCHAR2,
        TRACKING_ID   IN VARCHAR2,
        ACCOUNT_NO IN VARCHAR2,
        prepaidActDevDetails_tab IN prepaidActDeviceDetails_tabobj,
        ERROR_CODE OUT VARCHAR2);
    END SUBS_INS_API_SS;
    -----pkg body
    create or replace
    PACKAGE BODY SUBS_INS_API_SS
    AS
       PROCEDURE log_error (ip_code          IN VARCHAR2,
                            ip_message       IN VARCHAR2,
                            ip_description   IN VARCHAR2)
       IS
       BEGIN
          INSERT INTO ERR_LOG (IEL_REF_ID,
                               IEL_DATE,
                               IEL_CODE,
                               IEL_MSG,
                               IEL_DESC)
               VALUES (IVRS_ERR_LOG_SEQ.NEXTVAL,
                       SYSDATE,
                       ip_code,
                       ip_message,
                       ip_description);
       EXCEPTION
          WHEN OTHERS
          THEN
             ROLLBACK;
       END log_error;
       PROCEDURE INSERT_WS_LOG (SOURCE_SYS_ID   IN VARCHAR2,
                                STATUS          IN VARCHAR2,
                                TRACKING_ID     IN VARCHAR2,
                                ACCOUNT_ID      IN VARCHAR2,
                                MAC_ID          IN VARCHAR2)
       IS
          ws_log_rec   WS_LOG%ROWTYPE := NULL;
       BEGIN
          SELECT WS_LOG#REC#ID.NEXTVAL INTO ws_log_rec.rec#id FROM DUAL;
          ws_log_rec.VER#ID := 1;
          ws_log_rec.CRE#TS := SYSDATE;
          ws_log_rec.wl_source := SOURCE_SYS_ID;
          ws_log_rec.wl_status := Status;
          ws_log_rec.wl_tracking_id := tracking_id;
          ws_log_rec.wl_account_id := account_id;
          ws_log_rec.wl_mac_id := mac_id;
          INSERT INTO ws_log
               VALUES ws_log_rec;
       EXCEPTION
          WHEN OTHERS
          THEN
             ROLLBACK;
       END INSERT_WS_LOG;
        PROCEDURE REPLICO_DEV_INFO( Acc_id IN VARCHAR2, Mc_Id IN VARCHAR2,channel IN VARCHAR2,
                                     LOB_VAL IN VARCHAR2, outlet1 IN VARCHAR2, kit_cod IN VARCHAR2,
                                     serial_No IN VARCHAR2, shipperr IN VARCHAR2, estm_recived_date IN date)                                                                
        IS
                  Replico_device_info_det_Rec   Replico_device_info_det%ROWTYPE := NULL;
                  REC_ID  NUMBER;
        BEGIN
                  SELECT REPLICO_DEVICE_INFO_DET#RECID.nextval INTO REC_ID FROM dual; 
                   Replico_device_info_det_Rec.REC#ID := REC_ID;                 
                   Replico_device_info_det_Rec.ACCOUNT_ID := Acc_id;
                   Replico_device_info_det_Rec.MAC_ID := Mc_Id;               
                   Replico_device_info_det_Rec.CHANNEL_LINE_UP := channel;
                   Replico_device_info_det_Rec.LOB_VALUE := LOB_VAL;  
                   Replico_device_info_det_Rec.OUTLET := outlet1;
                   Replico_device_info_det_Rec.KIT_CODE := kit_cod;                
                   Replico_device_info_det_Rec.SERIAL_NUMBER := serial_No;                
                   Replico_device_info_det_Rec.SHIPPER := shipperr;                
                   Replico_device_info_det_Rec.ESTIMATED_RECIVED_DATE := estm_recived_date;
                  INSERT INTO replico_device_info_det
                        VALUES Replico_device_info_det_Rec;
                  EXCEPTION
                          WHEN OTHERS
                          THEN
                              ROLLBACK;
        END REPLICO_DEV_INFO;
       PROCEDURE SUBSCRIBER_INS_SS (
          SOURCE_SYS_ID              IN     VARCHAR2,
          TRACKING_ID                IN     VARCHAR2,
          ACCOUNT_NO                 IN     VARCHAR2,
          prepaidActDevDetails_tab   IN     prepaidActDeviceDetails_tabobj,
          ERROR_CODE                    OUT VARCHAR2)
       IS
          Input_Parameter_Is_Null       EXCEPTION;
          PRAGMA EXCEPTION_INIT (Input_Parameter_Is_Null, -2000);
          prepaidAccountDetails         prepaid_act_dvc_details_obj
                                           := prepaid_act_dvc_details_obj  (NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL,
                                                                              NULL);
          STATUS                        VARCHAR2 (1) := '1';
          cust_no                       VARCHAR (10);
          m_mac_id                      VARCHAR2 (20);
          channel_lineup                VARCHAR2 (25);
          LOB_VALUE                     VARCHAR2 (25);
          subscriber_master_Rec         subscriber_master%ROWTYPE := NULL;
        Replico_device_info_det_Rec   Replico_device_info_det%ROWTYPE := NULL;
          flg                           NUMBER (1);
          plan_code                     VARCHAR2(10);
          subs_aact_no                 NUMBER(20);
          m_plan_code1               payment_transaction_history.TH_PLAN_CODE%type;
          m_payment_mode1           payment_transaction_history.TH_PAYMENT_MODE%type;
          pm_phone_no_cur        subscriber_master.pm_phone_no%type;
          pm_status_cur          subscriber_master.pm_status%type;
          pm_user2_cur          subscriber_master.pm_user2%type;
          pm_user9_cur        subscriber_master.pm_user9%type;
          pm_cust_no_cur       subscriber_master.pm_cust_no%type;
          pm_cust_1            subscriber_master.pm_cust_no%type;
          cm_i                 customer_master.cm_status%type;
         CURSOR subs_rec is select pm_cust_no, pm_phone_no, pm_status, pm_user2, pm_user9 from subscriber_master
         where pm_cust_no = cust_no and pm_status= 'S';
       BEGIN
          IF (   Source_Sys_Id IS NULL
              OR Tracking_Id IS NULL
              OR ACCOUNT_NO IS NULL
              OR prepaidActDevDetails_tab.LAST = 0)
          THEN
             RAISE Input_Parameter_Is_Null;
          END IF;
          BEGIN
             SELECT cm_cust_no
               INTO cust_no
               FROM customer_master
              WHERE cm_cust_id = ACCOUNT_NO AND cm_status IN ('A', 'P', '0');
          EXCEPTION
             WHEN NO_DATA_FOUND
             THEN
                ERROR_CODE := 'SI001';
                log_error ('SI001',
                           SQLERRM,
                           'No Customer exist with Active or Pre Actiavted');
                INSERT_WS_LOG (Source_Sys_Id,
                               'F',
                               Tracking_Id,
                               Account_No,
                               prepaidAccountDetails.Mac_Id);
                STATUS := '0';
          END;
          BEGIN
             FOR i IN prepaidActDevDetails_tab.FIRST ..
                      (prepaidActDevDetails_tab.LAST)
             LOOP
                prepaidAccountDetails := prepaidActDevDetails_tab (i);
                prepaidAccountDetails.Status_of_device := '1';
                IF (   prepaidAccountDetails.Account_id IS NULL
                    OR prepaidAccountDetails.Mac_Id IS NULL
                    OR prepaidAccountDetails.LOB_value IS NULL)
                THEN
                   RAISE Input_Parameter_Is_Null;
                END IF;
                IF (prepaidAccountDetails.LOB_value = 'VIDEO')
                THEN
                   /* Commented as channel lineup is not coming from the input request */
                   /*IF(prepaidAccountDetails.Channel_Line_Up is NULL) THEN
                    Error_code :='SI002';
                   log_error ('SI002', SQLERRM, 'Channel line up is mandatory for Video');
                   INSERT_WS_LOG(Source_Sys_Id,'F',Tracking_Id,Account_No,prepaidAccountDetails.Mac_Id);
                   STATUS:=0;
                    prepaidAccountDetails.Status_of_device:='0';
                   END IF;*/
                   SELECT EC_CHANNEL_LINEUP
                     INTO channel_lineup
                     FROM ELIGIBLE_CUSTOMER
                    WHERE EC_CUSTOMER_NO = cust_no;
                END IF;
                BEGIN
                   SELECT 1
                     INTO flg
                     FROM subscriber_master
                    WHERE     pm_phone_no = prepaidAccountDetails.Mac_Id
                          AND pm_status IN ('P', '0', 'A', 'B');
                EXCEPTION
                   WHEN NO_DATA_FOUND
                   THEN
                      flg := 0;
                END;
                IF (flg = 1)
                THEN
                   ERROR_CODE := 'SI003';
                   log_error ('SI003',
                              SQLERRM,
                              'Customer Already Exist with given Mac Id');
                   INSERT_WS_LOG (Source_Sys_Id,
                                  'F',
                                  Tracking_Id,
                                  Account_No,
                                  prepaidAccountDetails.Mac_Id);
                   STATUS := 0;
                   prepaidAccountDetails.Status_of_device := '0';
                END IF;
                BEGIN
                   SELECT md_mac_id
                     INTO m_mac_id
                     FROM mac_details
                    WHERE     md_mac_id = prepaidAccountDetails.Mac_Id
                          AND md_start_date <= SYSDATE
                          AND md_status = 'A';
                EXCEPTION
                   WHEN OTHERS
                   THEN
                      ERROR_CODE := 'SI004';
                      log_error ('SI004', SQLERRM, 'Invalid Mac Id');
                      INSERT_WS_LOG (Source_Sys_Id,
                                     'F',
                                     Tracking_Id,
                                     Account_No,
                                     prepaidAccountDetails.Mac_Id);
                      STATUS := 0;
                      prepaidAccountDetails.Status_of_device := '0';
                END;
                 select pm_cust_no into pm_cust_1 from subscriber_master where pm_cust_no = cust_no;
                IF (STATUS = 1 AND prepaidAccountDetails.Status_of_device = '1')
                THEN
                     SELECT DECODE (prepaidAccountDetails.LOB_value,
                                  'HSD', 'HSD',
                                  'VIDEO', 'VDO')
                     INTO LOB_VALUE
                     FROM DUAL;
            OPEN subs_rec;
            LOOP
            FETCH subs_rec into pm_cust_no_cur, pm_phone_no_cur, pm_status_cur, pm_user2_cur, pm_user9_cur;
              IF subs_rec%FOUND THEN
                 IF
                  ( pm_cust_1 = pm_cust_no_cur and pm_user2_cur= LOB_VALUE and pm_user9_cur = prepaidAccountDetails.outlet and pm_status_cur = 'S')
                    THEN
                        update subscriber_master set pm_phone_no = prepaidAccountDetails.Mac_Id, pm_status = 'P', pm_name = prepaidAccountDetails.Mac_Id
                        where pm_cust_no = pm_cust_no_cur and pm_user9 = prepaidAccountDetails.outlet;
                         select cm_status into cm_i from customer_master where cm_cust_no = pm_cust_no_cur;
                            IF( cm_i = '0')
                            THEN
                                update customer_master set cm_status = 'P' where cm_cust_no = pm_cust_no_cur;
                             END IF;
                             REPLICO_DEV_INFO( prepaidAccountDetails.Account_id, prepaidAccountDetails.Mac_Id,channel_lineup,
                                               prepaidAccountDetails.LOB_value, prepaidAccountDetails.outlet, prepaidAccountDetails.kit_code,
                                               prepaidAccountDetails.serial_Number, prepaidAccountDetails.shipper,prepaidAccountDetails.estimated_recived_date);
                    ELSIF
                        ( pm_cust_1 = pm_cust_no_cur and pm_user2_cur= LOB_VALUE and pm_user9_cur = null and pm_status_cur = 'S')
                          THEN
                             update subscriber_master set pm_phone_no = prepaidAccountDetails.Mac_Id, pm_status = 'P', pm_name = prepaidAccountDetails.Mac_Id, pm_user9 = prepaidAccountDetails.outlet
                             where pm_cust_no = pm_cust_no_cur and pm_user9 = NULL;
                             update customer_master set cm_status = 'P' where cm_cust_no = pm_cust_no_cur;
                             REPLICO_DEV_INFO( prepaidAccountDetails.Account_id, prepaidAccountDetails.Mac_Id,channel_lineup,
                                               prepaidAccountDetails.LOB_value, prepaidAccountDetails.outlet, prepaidAccountDetails.kit_code,
                                               prepaidAccountDetails.serial_Number, prepaidAccountDetails.shipper,prepaidAccountDetails.estimated_recived_date);
                    END IF;
                 ELSIF subs_rec%NOTFOUND THEN
                       SELECT PM_SUBS_ACT_NO_SEQ.NEXTVAL
                       INTO subs_aact_no
                       FROM DUAL;
                       subscriber_master_rec.PM_SUBS_ACT_NO := subs_aact_no;
                       subscriber_master_Rec.pm_phone_no :=
                        prepaidAccountDetails.Mac_Id;
                       subscriber_master_Rec.pm_open_date := SYSDATE;
                       subscriber_master_rec.pm_status := 'P';
                       subscriber_master_rec.PM_CUST_LVL_YN := 'S';
                       subscriber_master_rec.PM_EQUP_CODE := LOB_VALUE;
                       subscriber_master_rec.PM_HOME_AREA := 'HOM';
                       subscriber_master_rec.PM_USG_CODE := 'USG';
                       subscriber_master_rec.PM_NO_TYPE := 'S';
                       subscriber_master_rec.PM_TCG_CODE := 'DEF';
                       subscriber_master_rec.PM_APLN_DATE := SYSDATE;
                       subscriber_master_Rec.PM_NAME := prepaidAccountDetails.Mac_Id;
                       subscriber_master_Rec.PM_STAFF_id := '16';
                       subscriber_master_rec.PM_USER2 := LOB_VALUE;
                       subscriber_master_rec.PM_USER3 := channel_lineup;
                       subscriber_master_rec.pm_cust_no := cust_no;
                       subscriber_master_rec.PM_USER8 := 'Y';
                       INSERT INTO subscriber_master
                       VALUES subscriber_master_rec;
                       REPLICO_DEV_INFO( prepaidAccountDetails.Account_id, prepaidAccountDetails.Mac_Id,channel_lineup,
                                         prepaidAccountDetails.LOB_value, prepaidAccountDetails.outlet, prepaidAccountDetails.kit_code,
                                         prepaidAccountDetails.serial_Number, prepaidAccountDetails.shipper,prepaidAccountDetails.estimated_recived_date);
             END IF;
             END LOOP;
             CLOSE subs_rec;
                  SELECT TH_PLAN_CODE,TH_PAYMENT_MODE
                   INTO m_plan_code1,m_payment_mode1
                   FROM PAYMENT_TRANSACTION_HISTORY
                   WHERE TH_CUSTOMER_NO = cust_no
                   AND TH_LOB = LOB_VALUE
                   AND TH_SUBSCRIBER_NO IS NULL;
                   IF(LOB_VALUE = 'HSD') THEN
                    IF(m_plan_code1 = 'SIKI') THEN
                          plan_code := 'SIKI';
                                             ELSE
                      plan_code := 'KIT';
                    END IF;
                   ELSE
                    IF(m_plan_code1 = 'SIKT') THEN
                             plan_code := 'SIKT';
                    ELSE
                          plan_code := 'TV';
                    END IF;
                   END IF;               
                          UPDATE PAYMENT_TRANSACTION_HISTORY SET TH_SUBSCRIBER_NO = subs_aact_no, th_writeback_status = 'Y' WHERE TH_CUSTOMER_NO = cust_no AND TH_PLAN_CODE = plan_code;
                          COMMIT;
                END IF;
             END LOOP;
          END;
       END SUBSCRIBER_INS_SS;
    END SUBS_INS_API_SS;
    --- type object
    create or replace
    TYPE   prepaid_act_dvc_details_obj--prepaidAccountDeviceDetailsObj
    AS     OBJECT ( Account_id VARCHAR2 ( 25 )
           , Mac_Id VARCHAR2 ( 25 )
           , Channel_Line_Up VARCHAR2 ( 25 )
           , LOB_value VARCHAR2 ( 25 )
           , Status_of_device VARCHAR2 ( 25 )
            , outlet VARCHAR2(25)
            , kit_code VARCHAR2(25)
            , serial_Number VARCHAR2(25)
            , shipper VARCHAR2(25)
            , estimated_recived_date date )
    type---
    create or replace
    TYPE prepaidActDeviceDetails_tabobj as table of prepaid_act_dvc_details_obj
    ---- i need to run this package via separate procedure. but i don't know how to pass the variable. because the passing argument contain object tab variable. please help me.. give me suggestion or procedure to run this pkg.

  • I keep on getting this error when i try to copy files to my 2T Time Capsule, Please help im running out of space on my MacBook Pro.... The operation can't be completed because an unexpected error occurred (error code -50)

    I keep on getting this error when i try to copy files to my 2T Time Capsule, Please help im running out of space on my MacBook Pro....
    The operation can’t be completed because an unexpected error occurred (error code -50)

    I would get an external drive today and copy all your stuff off the TC.. forget trying to load more onto it. There is a good chance after 3years (A 2TB should be only about 2years tops), the disk or the TC itself is on the way out. Do it immediately. If TM is also failing to backup you need to recognise symtoms of impending doom.
    Unfortunately the error messages are archane and it is hard to discover their meaning.
    You also cannot verify a network drive.. you can verify the TM sparsebundle though so do that.
    A5. http://pondini.org/TM/Troubleshooting.html
    Reboot the whole network from off.. certainly if you run later OS it can simply lose the drive..
    If you still fail to be able to copy to the TC.. then get that external and copy off it. Tell us if you can do that.

  • Can it be easier when running  simple examples in jmstutor

    Hi, I'm a new user of java. when I tried to use Simple examples in jms_tutorials, such as SimpleQueueSender.java, I found I had to type a long command:
    java -Djms.properites=%J2EE_HOME%\config\jms_client.properties SimpleQueueSender MyQueue 3
    It seems a little inconvienent.
    Can I first set the properties, then run the programe?
    How?
    Thanks a lot!

    You could put the command in a script and run it that way. But you do need to pass that -D option to the java command at J2EE 1.3.1.
    You could move to J2EE 1.4 Beta and use the J2EE Tutorial Addendum, which simplifies running the examples by providing Ant build scripts.
    Kim Haase
    Technical Writer
    Sun Microsystems, Inc.

  • Is anyone know how to run the examples in 3d user interfaces with java 3d

    hi dear ,
    I am trying to run the examples in 3d user interfaces with java 3d.
    I hope i can load the library in jcreator. but the libarary for this book are classes files , it do not have jar file for it . the jcreator do not read these classes . i do not know why ? i am wonder if there any one run these code before can give me some idear .
    thanks so much .
    the code u can get from this link.
    http://www.manning.com/books/barrilleaux/source
    thank you for u to have a look for me .
    regards
    xiaocui

    <h2>{color:red}CROSS POSTED{color}</h2>
    [t-5289810]
    Cross posting is rude.
    db

  • TS1363 I tried to print off some of the iTunes advice but my computer froze. I re-booted the computer and ran the diagnostic test again but now "Secure link to itunes store failed"  AND " itunes helper not running."

    I just tried to print off some itunes advice but my computer froze.  I re-booted it and ran the ipod diagnostic test again to get back to the screen I was on. This time "Secure Link to  i tunes store failed" AND "i tunes helper not running" both appeared.   Please help, all I can see is "Appears in Windows but not iTunes" at the top of the screen.  Even though I only vaguely know what that means, I don't think that's the help I need.    

    I just tried to print off some itunes advice but my computer froze.  I re-booted it and ran the ipod diagnostic test again to get back to the screen I was on. This time "Secure Link to  i tunes store failed" AND "i tunes helper not running" both appeared.   Please help, all I can see is "Appears in Windows but not iTunes" at the top of the screen.  Even though I only vaguely know what that means, I don't think that's the help I need.    

  • Trying to run an example

    Hello guys
    i am reading the good tutorials about of Technical Articles and Tips of j2me
    i have a problem ,well i am in linux with j2me toolkit 2.2 and use the jvm or jdk 1.5 update 1
    and trying to run the example with servlets to send an email
    http://developers.sun.com/techtopics/mobility/midp/articles/socketRMI/
    well this example consist in 3 java files how is evident
    a EmailMidlet.java,EmailSender.java,EmailServlet.java
    well i put EmailMidlet.java in the src (folder apps toolkit) of an project to execute the example
    the rest of both java files go to an independent project or folder in tomcat (5.5.9)
    (the web.xml and classes is fine) coz i execute other examples of the same style (that needs localhost or tomcat)
    well i change of course the line of the url to my localhost
    and when i try to send the email appear this message in my visual console in the toolkit
    (is not the unique case related with servlets and email, coz there is an another example of this style that
    throw this message) and the application,
    Project settings saved
    Building "SUN02"
    Build complete
    Running with storage root DefaultColorPhone
    Warning: To avoid potential deadlock, operations that may block, such as
    networking, should be performed in a different thread than the
    commandAction() handler.
    and of course the application deadlock
    how i can fix the code?
    p.d:i only change the line of the url
    thanks a lot for your time

    Hi,
    What are u exactly using? The PLSQL front-end or the Java front-end? How are u seeing this cut off? Is it in SQLPlus or ur own application?
    thanks
    Murali

Maybe you are looking for

  • Oracle Query failing for multiple rows:

    Hey Guys, I have been given a task to produce an ad-hoc report based on the following conditions (I will give you the structure of the table and details in the table below the requirements) Requirements: Adhoc Report for Audit on CIT Income Allocatio

  • My Apple TV remote is not working.

    My Apple TV remote is not working. It was fine this morning, but now ATV is not responding to it.  It still access iTunes on my Mac so I don't think it's a battery issue. The white light flashes on ATV, but nothing happens.  I have restarted ATV seve

  • Is it possible to predict the type of 128GB SSD drive that will be included in my recent T400 order?

    Hello all, Just ordered my T400 yesterday and today I found that some customers are still getting "Generation 1" SSD devices made by Samsung (MMCQE28G8MUP-0VA) but luckily there are some that get the new "gen 2" drives - (MMCRE28G8MXP-0VB). I see thi

  • Samsung Monitor acting strange when connected with digital cable.

    I have a Powermac G5 dual 2.7 GHz desktop. I am connecting a Samsung 2233BW monitor. When I connect the monitor from its digital connection using the digital cable I have a problem bringing the monitor back from sleep mode. I get horizontal jagged li

  • Oracle optional input parameters

    Hi, I have a SP named sp_actualizar_parametr that has 3 input parameters, all of Number type, and one of them is optional. How can I do so that my class reflects that situation, how can I passa a null to the optional field? now I have: public static