Defining your own type in java...?

is there anything similar to C's enum in java for defining your own types?
i.e. id like to make my own boolean type which isnt restricted to just true or false, but rather can be also undefined.
any help will be appreciated

That has nothing to due with C's enum construct.
No there isn't. I think it will be in the next
version.
Have a look here how to make one:
http://developer.java.sun.com/developer/Books/effective
ava/Chapter5.pdfic, so iz it something like generics?

Similar Messages

  • Style Elements - defining your own ?

    hi,
    I have a list of typography elements to define styles
    for - can map most to 'heading1', 'heading2', 'Portlet
    Header', etc. style elements in the portal style.
    however, to make more meaningful names for our site -
    e.g. 'Content Header', 'copy text' etc - would be
    useful to define our own style elements (while still
    utilising the portal's 'edit style' page - don't want
    to have to resort to our own css style sheets).
    I have used item attributes to force new elements on
    the Item Element Type - and this will work (exposes
    our own defined style elements in the style sheet, and
    allows our own naming system).
    question is - are there any other ways of achieving
    this? has anyone else done something similar?
    also - can we rename 'heading1','heading2' etc to
    our own more meaningful names?
    also - anyone else think it would be useful to be
    able to specify pixels as well as point for font
    size?
    thanks
    kev

    That has nothing to due with C's enum construct.
    No there isn't. I think it will be in the next
    version.
    Have a look here how to make one:
    http://developer.java.sun.com/developer/Books/effective
    ava/Chapter5.pdfic, so iz it something like generics?

  • How to define your own context in an EJB environment - possibly distributed

    I would like to setup a context (an object accissible per logical thread) in an EJB environment, but I am too unfamiliar with the options I may have.
    My objective is to create a context in which I may set a value, then invoke a method on an object (which in turn invokes a method on another object and so forth) and eventually get back the value from the context. In other words I am trying to pass a value without passing it as a parameter. More specifically, I have written a JDBC Driver wrapper in which I want to intercept a number of method calls and based on the context settings perform one or the other JDBC preprocessing. The reason for not passing the values as parameters is to interfere as little as possible with any environment in which this code is to be integrated. I simply want to set the context and get the context (in my JDBC wrapper) without the surrounding code needing to change.
    I have succeded partially by using a ThreadLocal object to hold my context. I can set and get the values to and from the context and actually pass values to my Driver wrapper without explicitly passing them as parameters. This works well in a non-EJB environment. My concern arises when I switch to the EJB environment.
    If my context is set in a session bean, which invokes an entity bean, am I then guaranteed that these will execute in the same physical thread?
    If the session and the entity beans are hosted on seperate machines then the answer would certainly be NO. Is there any way to have the container manage the context and propagate it accross containers when needed?
    Any thoughts or suggestions on this topic are wellcome, even if they don't solve the issue entirely.
    Looking forward to hear from you all!
    /poul

    In an EJB environment, you have absolutely no control over threading issues. (It was purposefully designed that way.) However, you do have your own little "sandbox" in the EJB ClassLoader - which is why there is a lot of use of the Singleton pattern for factories and (very carefully!) as small caching mechanisms. You might want to look into that avenue - but you have to know how your EJB vendor's ClassLoader scheme works (there does appear to be a convergence in this area) and you must be very sensitive to potential thread-blocking operations that may take a while to complete.

  • Defining my own types

    What i want to do i create class that is called "Company" and with in the class there should be an array that contains multiple data:
    Example:
    Class Company{
    Myowndatatype{
    date date;
    int price;
    int time;
    Myowndatatype[] = new Myowndatatype();
    How is this best done in java, should i use an interface, or just make another class or what?

    Why is a List better to use then a old school array? Is not an array much faster?List is "better" because it offers a more extensive, easy-to-use API and automagically handles a lot of the manual mess associated with dealing with arrays. Whether an array is faster or not is in all likelihood the completely wrong question to ask; better to worry about writing clean, simple, well-designed, easy-to-read code. Chances are better than excellent that Java's List implementations will be far more than fast enough.
    ~

  • No special G/L acct defined for acct type K sp.G/L ind. Y recon.acct

    Hello Friends,
    When we used transaction F-48 for down payment of supplier, but on process we found error " No special G/L acct defined for acct type K sp.G/L ind. Y recon.acct XXXXXX.
    I have checked transactions FBKP & OBYR and entries are maintained for "acct type K sp.G/L ind. Y .
    Please suggest.
    Best regards,
    Jeetendar

    Hi ,
    Its looks like  you have defined your own Special GL indicator . Can you Please check in OBYR the properties of Y indiactor . Please see below 2 screen shot and check your Y as below . If this doesnot solve can you Please Paste the full error in Screen Shot.

  • How to call nested table type from Java

    I needed a 2 dimensional array and asked the questuion here.
    [Original thread| http://forums.oracle.com/forums/message.jspa?messageID=3419944#3419944]
    I have my program working correctly in pl/sql.
    The java guys are building this array and passing it in to me, but they don't know how.
    A small example of this would be appreciated.
    Heres an example of the procedure prototype and the type definitions in use
    create or replace
    type csn_array_obj
    as object
    (csn varchar2(20 char),
    box_id varchar2(10)
    create or replace
    type csn_array_type is table of csn_array_obj;
    procedure populate_stock(
    p_csn_array in csn_array_type
    added in example of object and type definition.

    There's an orl Oramag article by Tom Kyte rounding up [some Java tips|http://asktom.oracle.com/tkyte/omag/00-nov/o60tom.html] which includes an example of how to do this. You'll need to replace Tom's SIMPLARRAY with your own type.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • How to define our own selection screen for logical database  in abap-hr?

    Hi Friends,
    Can u please help me
    How to define your own selection screens for  logical database.
    we use to do like(goto->attributes-HRReportcatagerious ).but How to desin using  customer table like t599c, t599f and how to add to my logical database?
    Thanks in advance
    charan

    check out this online help
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/dba65c35c111d1829f0000e829fbfe/frameset.htm
    Regards
    Raja

  • Steps to create your own self signed certificate with java plugin working

    You need two tools that comes with your jdk which are keytool and jarsigner.
    Steps explain below in detail. Don't use netscape signtool, it will NEVER work!
    * keytool -genkey -keyalg rsa -alias tstkey -keypass 2br2h2m -dname "cn=Test Object Signing Certificate, o=AI Khalil, ou=Java Products, c=AU"
    cn = Certificate name
    o = organistation
    ou = organistation unit
    c = country (first two letters)
    If don't put the -dname, you can fill it line by line.
    The -keypass has to be verify at the end, and you have to wait for it to create the rsa signing keys.
    On NT by default it will put the alias information at D:\WINNT\Profiles\Administrator (if log in as administrator) with the default file called ".keystore". Windows 98 etc, don't know, search for .keystore
    file. When you update it, check for the timestamp change and you know if you at the right spot.
    You can store your alias information via the -storepass option to your current directory you work on, if you don't want to update the default .keystore file?
    The .keystore contains a list of alias so you don't have to do this process again and again.
    Another tip if you want your certificate encryption validity to be more than the default one month is simply
    add the -validity <valDays>, after the -genkey option, to make your certificate usage for encryption to last much longer.
    Note: You MUST use the -keyalg rsa because for starters the rsa encyption alogorthim is supported on ALL browsers instead of the default DSA and the other one SHA. Java plugins must work with the RSA algorthim when signing applets, else you will get all sorts of weird errors :)
    Do not use signtool because thats a browser dependant solution!! Java plugin is supposed to work via running it owns jre instead of the browser JVM. So if you going to use netscape signtool, it starts to become a mess! ie certificate will install, but applet won't start and give you funny security exception errors :)
    * keytool -export -alias tstkey -file MyTestCert.crt
    It will read the alias information in the .keystore information picking up the rsa private/public keys info and
    create your self sign certificate. You can double click this certificate to install it? But don't think this step is needed but maybe for IE? Someone else can check that part.
    If you make a mistake with the alias, simply keytool -delete -v -alias <your alias key>
    If not in default .keystore file, then simply keytool -delete -v -alias <your alias key> -keystore <your keystore filename>
    * Put your classes in your jar file, my example is tst.jar.
    * jarsigner tst.jar tstkey
    Sign your testing jar file with your alias key that supports the RSA encryption alogorthim.
    * jarsigner -verify -verbose -certs tst.jar
    Check that its been verified.
    The last step is the most tricky one. Its to do with having your own CA (Certified Authority) so you don't
    have to fork out money straight away to buy a Verisign or Twarte certificate. The CA listing as you see in
    netscape browsers under security/signers, is NOT where the plugin looks at. The plugin looks at a file called
    CACERTS. Another confusion is that the cacerts file is stored in your jre/lib/security AND also at your
    JavaSoft/Jre/<Java version>/lib/security. When you install the Java plugin for the first time in uses your
    JavaSoft folder and its the cacerts file that has to be updated you add your own CA, because thats where
    the plugin look at, NOT THE BROWSER. Everything about plugin is never to do with the browser!! :)
    * keytool -import -file MyTestCert.crt -alias tstkey -keystore "D:\Program Files\JavaSoft\JRE\1.3.1\lib\security/cacerts"
    Off course point to your own cacerts file destination.
    Password to change it, is "changeit"
    Before you do this step make a copy of it in its own directory in case you do something silly.
    This example will add a CA with alias of my key called "tstkey" and store to my example destination.
    * keytool -list -v -keystore "E:/jdk/jdk1.3/jre/lib/security/cacerts"
    List to see if another CA is added with your alias key.
    Your html, using Netscape embed and Internet explorer object tags to point to the java plugin,
    your own self sign applet certificate should work
    Cheers
    Abraham Khalil

    I follow Signed Applet in Plugin, and it's working on
    my computer. Thanks
    But When I open my applet from another computer on
    network, why it does not work ..?
    How to make this applet working at another computer
    without change the policy file ..?
    thanks in advance,
    AnomYou must install the certificate on that computers plugin. Can this be done from the web? can anyone suggest a batch file or otherwise that could do this for end users?
    I want a way for end users to accept my cert as Root or at least trust my cert so I dont have to buy one. I am not worried about my users refusing to accept my cert. just how do I make it easy for them? IE you can just click the cert from a link, but that installs for IE, and not the plugin where it needs to be.

  • Error in saving customer information. Value for contact_point_purpose must be a value defined in lookup type CONTACT_POINT_PURPOSE.

    I was trying to create a text alert. I was calling following in jsp
    email.setContactPointPurpose(myLookUpCode); //say XXMY_SMS_SHIP
            PartyManager.createEmail(email, ApiConstant.CONTACT_POINT);
    Getting following exception:
    Error in saving customer information.
    Value for contact_point_purpose must be a value defined in lookup type CONTACT_POINT_PURPOSE.
    Error trace:
    oracle.apps.ibe.customer.CustomerException: Error in saving customer information. at oracle.apps.ibe.tcav2.Email.create(Email.java:187) at oracle.apps.ibe.tcav2.PartyManager.createEmail(PartyManager.java:116) at _oa__html._myfile__ibeMyFile._jspService(_myfile__ ibeMyFile.java:908) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267) at oracle.jsp.JspServlet.internalService(JspServlet.java:186) at oracle.jsp.JspServlet.service(JspServlet.java:156) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:662) Caused by: oracle.apps.jtf.base.resources.FrameworkException: Value for contact_point_purpose must be a value defined in lookup type CONTACT_POINT_PURPOSE. at oracle.apps.jtf.util.ErrorStackUtil.getFrameworkException(ErrorStackUtil.java:104) at oracle.apps.jtf.util.ErrorStackUtil.getDBFrameworkException(ErrorStackUtil.java:141) at oracle.apps.ibe.tcav2.Email.create(Email.java:185) ... 11 more Error in saving customer information. oracle.apps.jtf.base.resources.FrameworkException: Value for contact_point_purpose must be a value defined in lookup type CONTACT_POINT_PURPOSE. at oracle.apps.jtf.util.ErrorStackUtil.getFrameworkException(ErrorStackUtil.java:104) at oracle.apps.jtf.util.ErrorStackUtil.getDBFrameworkException(ErrorStackUtil.java:141) at oracle.apps.ibe.tcav2.Email.create(Email.java:185) at oracle.apps.ibe.tcav2.PartyManager.createEmail(PartyManager.java:116) at _oa__html._myfile__ibeMyFile._jspService(_myfile__ ibeMyFile.java:908) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267) at oracle.jsp.JspServlet.internalService(JspServlet.java:186) at oracle.jsp.JspServlet.service(JspServlet.java:156) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:662) Value for contact_point_purpose must be a value defined in lookup type CONTACT_POINT_PURPOSE.

    Tried this but it is giving the below error
    APP-FND-01242: Cannot read value from field PER_ASSIGNMENT_ID
    Cause: The field PER_ASSIGNMENT_ID could not be located or read.
    Action: This error is normally the result of an incorrectly-entered field name string in a trigger, or a field name string that does not uniquely specify a field in your form. Correct your trigger logic to precisely specify a valid field.

  • AP Check printing setups for printing checks on your own

    HI
    I am wondering if there a good document which deals with AP check printing with MICR and signature on your own check stock
    thanks

    Recently we started to deal with AP check printing in our organizatin. It was a daunting task with the information and resources scattered all over and missing critical pieces of information to make sense out of the whole process flow. We attempted to go through the AP check printing internally and succeded.
    I decided to post the information for the benefit of people about the our experience
    Check Printing Basics and Beyond for Printing Checks on Your Own
    by
    Sarma Chilukuri
    This article deals with what is needed to get your own checks printed. It is a first attempt to uncover all the hidden rules that one should be aware to get your own checks printed. The first section deals with the basic AP check printing setup, while the 2nd half explores some of the flow of events that make it possible to print the check.
    Part I – Basic Setup
    AP Setup for check printing
    There are multiple steps in the AP check printing. First set of steps deal with the AP side setups. The second step is to get the System side setups. The system side setup deals with printer setup and program options setups. The last step would be to make the print format files configured with the vendor provided escape sequences in the laser print format file.
    Step 1: login as Payable Manager
    Step 2: Bank Setup: Navigate to Setup: Payments > Banks
    1.     Make sure the Bank # etc are present
    2.     Tab to “Bank Accounts”, and make sure your account # has been setup
    3.     On the Bank Accounts screen, tab to the “Payables Documents” and verify that Payment format (E.g., COK Laser Format) has been entered. This “Payment format links to next section where we associate it to the right payment program.
    Fig 1. AP Payment Bank Setup Screen
    Step 3: Program Setup (Setup: Payments > Programs)
    As we know there are only 5 formats 3 of which are “Ever Green Laser” (APXPBFE G|L|F) which are explained in the AP Users Guide. For your own form printing, you have to associate the format to APXPFEL (laser format) program. Also, the APXPBFEL or APXPBFEF call the APXPBFEG, which is the base program that pulls the data from oracle base tables. APXPBFEL is the one which allows us to print the checks with MICR and signature on a plain paper not on a pre printed stationery.
    Fig. 2 AP Payment Format Setup Screen
    Printer Styles, Drivers setup
    The above process summarizes the AP Setup. As a DBA, the printer setup needs to be validated. The base install provides the right setup to some extent. But the differences in printers and print queues may add some complexity to the final configuration. The following section discusses the set up the base install provides and changes as needed.
    Step 1. Login as system Administrator
    Step 2: Style (Install : Printer > Style)
    Look for the “PORTRAITHPLJ4LASCHECK”. This one is associated with the SRW Driver Called, “APLASP” (AP Laser printer format).
    Step 3: Driver (Install : Printer > Driver).
         1. The “PORTRAITHPLJ4LASCHECK” is associated with a “User Driver” of PORTRAIT for HPLJ4 and and a SRW driver of “APLASP”
         2. Also notice that there is an Initialization string at the bottom of it. This initialization string gets called as pre-report trigger for the APXPBFEG program (APXPBFEG.rdf) file. It sets the kind of format it should be. Please see the Appendix A for details on these printer pcl code translations. The Initialization string was as follows:
    Initialization: /eE/e&l0o2a7C/e(s0P/e(8U
    Step 4: Printer type (Install : Printer > Register)
    Each printer type is associated with a set of styles. Make sure the printer that was selected has the above style and its associated driver listed against that.
    Fig. 3 System Administrator Printer Seups
    Step 5: Program Setup (Concurrent > Program > Define)
    This step holds the key for check printing. It is necessary to define whether you need the check on top followed by the Stub or the other way around. The way it is controlled is based on the APXPBFEG.rdf, the report definition file and the APLASP.prt (Printer Style associate with the Portrait laser check format SRW driver). The APLASP.prt file ($FND_TOP/reports) has two identical setups called the 100 series and the 200 series. Those identical sets of setups define where the MICR and signature print on the check. The following table lists the some of the codes in the 100 series. Please refer to Doc ID #146452.1 for complete details.
    Fig. 4 System Administrator Concurrent Program Definitions
    CODE #     Code Definition
    100     Electronic check activation string
    101     1st Check #
    102     2nd Check #
    104     Deactivate check number mode string
    111     Activate MICR line
    112     MICR Deactivation / reset the printer head position
    121     1st Signature
    122     2nd Signature
    141     Address font activation string
    199     Return to default state string
    Table 1. APLASP.prt -- MICR Activation Codes
    The above code block repeats itself the same way in the 200 series. The decision to activate one way or the other controls the Check printing.
    Step 2: Setting up the Option block
    In the concurrent program definition for the APXPBFEL, there is an Options block in the middle. You need to list the codes that you want to activate. Please refer to Doc ID # 186640.1 for some explanation on these.
    E.g.,
    p_printer_code_mask="201,211,221,241" p_sig2_amount="" p_sig3_amount="" p_sig1_vendnum="" p_sig2_vendnum="" p_sig3_vendnum="" p_country_to_ignore="US" p_continuous_stationery="N"
    Step 3: Output format is Text
    Text format is sufficient, as the printer will pick up these escape sequences anyway.
    Fig. 5 System Administrator Concurrent Program APXPBFEL Options Definition
    UIPRINT.TXT, UIFONTS.ALI
    One needs to be aware of a few more pieces in this puzzle. The UIPRINT.TXT identifies to the Oracle Applications the print queues that were setup. This file is needed to set your PCL / Post Script printer definitions. I did not have to really tinker with these files other than identifying the PCL and Post Script Q’s that were setup on the UNIX box.
    Part II: Integrating all the pieces
    The above setups are all documented in various articles. We need to understand a few more steps to see how all these pieces come together.
    What you need to know about APXPBFEG.rdf
    APXPBFEG (.rdf) is the report file which when called pulls the data from Oracle. If you open the APXPBFEG.rdf in the Oracle reports, there is initialization to the report called, SRW.Init. This will bring in the initialization string associated with the PORTRAITHPLJ4LASCHECK driver definition file. Also, please be very careful with this report format file. When you open it, there is small tiny empty block. in the first block which calls the printer initialization code 100/200 under the Format Mask (from APLASP.prt). If this portion gets changed or messed up, one can end up with some unexpected results. Each of those blocks like MICR, CHECK etc… have associated format triggers and printer codes.
    Please make sure that the printer mask is properly handled. I noticed that the 200 series MICR (211) and Signature (221) printer masks were tied to 111 and 121 respectively. These should have been 211 and 221. The other place you need to be careful was the printer code before and after is proper.
    For E.g.,
    For the MICR, the ”printer code before and after columns “ should be 111 and 112 (or 211 / 212) respectively while Format Trigger should reference to 111 (211).
    Fig. 6 APXPBFEG rdf file printer mask and Format Triggers
    The escape sequences in the APLASP.prt file for these codes will play the crucial role in getting our format around the report output that gets generated from the APXPBFEG program. Please refer to the explanation of these escape sequence codes in the APPENDIX A.
    At this point when you run the program, you will see that the formatted output report file will have all the initialization strings and the output associated with that. You can compare the fields and verify the results. Let us closely examine the parts of the 111 and 121 where the micr and signature prints. The key to this to code the escape sequences the right way to get the associate MICR and signature print out correctly.
    Fig. 7 APXPBFEG rdf file MICR printer mask and Format Triggers
    Code 111 and Code 112 from the APLASP.prt file.
    I broke the line into pieces to illustrate the exact escape sequence code.
    Code "211"
    Part 1: esc "&f0S" esc "&f0y0X" esc "&l0E" esc "&a0L"
    Part 2: esc "(8M" esc "(s0p8.00h8.0v0s0b80T" --- This will be provided by the ROM
    Cartridge provider
    Part 3: esc "&k15H" esc "*p3215Y" esc "&a13.8C"
    code "212"
    Part 1 : esc "&f1x3x8X"
    Part 2 : esc "&f1S"
    Let us go over these 2 sets of codes carefully.
    Escape Code     Meaning     Comment
    esc "&f0S"      Push Cursor Position     
    esc "&f0y0X"     Define Macro ID 0 and Start Macro Definition     
    esc "&l0E"      Define Top Margin at 0 Lines     
    esc "&a0L"      Define Left Margin at Column 0     
    esc "(8M"     8M Symbol SetNote : As per pcl codes this happens to be Font Primary JIS Math 8 symbol     MICR Part 1 : Provided by the Vendor from where you the ROM cartridge
    esc "(s0p8.00h8.40s0b0T"     {Fixed Pitch}{pitch 8.00 cpi}{Font Style 8.40}{Medium Weight}{Typeface 0}     MICR Part 2 : Provided by the Vendor
    esc "&k15H" esc "*p907Y"     Set HMI = 15/120" Vert position = 907 Dots     
    esc "&a13.8C"     Move to Column 13.8     
         CODE 112     
    esc "&f1x3x8X"     {End Macro Definition}{Call Macro}{Delete Macro ID}     
    esc "&f1S"     {Pop Cursor Position}     At this point, the MICR gets printed
    Table 2. Escape Sequences in APLAP.prt file Explanation
    Fig. 8 APXPBFEG rdf file Signature printer mask and Format Triggers
    The signature piece (221) has also similar meaning.
    Escape Code     Meaning     Comment
    esc "&f0S"     Push Cursor Position     
    esc "*t300R"     300 DPI Graphics resolution     
    esc "*p1500X"     Horiz position = 1500 Dots     
    esc "*p650Y"     Vert position = 470 Dots     
    esc "(4B" esc "(s1p53v0s0b102T"esc "&f0S!"     Symbol SetProportionalPoint Size 53UprightMedium WeightTypeface 102Push Cursor Position!     Vendor gave the us esc "(4B"esc"(s1p53v0s0b102T!"Note: the ! when the it pushes the ! and that is where it prints the signature piece. The first part forms the symbol set , say (4B and the later part forms the signature font and ! is the piece. I took the ! from the above and let it stay with the 3rd part of it so that signature does not print twice.
    esc "&f1S"      Pop Cursor Position     
    esc "*p+121Y"     Move down 121 Dots     
    esc "&f1S"     Pop Cursor Position     
    Table 3. Escape Sequences for Signature in APLAP.prt file and Explanation
    Summary
    One can print their own checks using the above steps. This can work as a cost effective solution for small organizations where the budgetary constraints are tighter. We are successful in getting the AP Checks printed using the above method.
    References
    Metalink Doc ID # 186640.1, Different Payment Formats …
    Metalink Doc ID # 60936.1, Step by Step Guide to Setup a Printer in Oracle Applications
    Metalink Doc ID # 250543.1, How to Create An Initialization String for a Payable Check Format
    Metalink Doc ID # 48680.1, Accounts Payable FAQ – Payment Batch, Check
    Metalink Doc ID # 1074792.6, Exclamation Point (!) Prints On Check When Using APXPBFEL And Cartridge
    Metalink Doc ID # 158486.1, APXPBFEL Evergreen (Long Laser)
    Metalink Doc ID # 146452.1, Listing of p_printer_code_mask Default Values for APXPBFEL
    Chapter 2, Oracle Payables user guide
    Appendix A
    APLASP.prt printer codes explanation
    code "200" esc "&l0o2a6d66p8.000c2e1x0l63f1H" esc "&k12.00H" esc "(8U"
    esc "(s0p10.00h12.00v0s0b3T" esc "&k11.75H" esc "&a1l0R" control(M) esc"&f3005y4X"
    {Portrait}
    {Letter}
    {6 LPI}
    {Define Page Length to 66 Lines}
    {Set VMI = 8.000/48"}
    {Define Top Margin at 2 Lines}
    {Select 1 Copies}
    {Disable Perf Skip}
    {Define Text Length as 63 Lines}
    {Feed from Tray 1 (upper)}
    0.1 esc "&k12.00H"
    {Set HMI = 12.00/120"}
    0.2 esc "(8U"
    {Roman-8 Symbol Set}
    0.3 esc "(s0p10.00h12.00v0s0b3T"
    {Fixed Pitch}
    {pitch 10.00 cpi}
    {Point Size 12.00}
    {Upright}
    {Medium Weight}
    {Typeface 3}
    0.4 esc "&k11.75H"
    {Set HMI = 11.75/120"}
    0.5 esc "&a1l0R"
    {Define Left Margin at Column 1}
    {Move to Row 0}
    control(M)
    0.6 esc"&f3005y4X"
    {Define Macro ID 3005}
    {Enable Overlay}
    code "201" esc "&f0S" esc "&a1.25r70C" esc "(8U" esc "(s1p14v0s3b4148T"
    {Push Cursor Position} esc "&f0S"
    1.1 esc "&a1.25r70C"
    {Move to Row 1.25}
    {Move to Column 70}
    1.2 esc "(8U"
    {Roman-8 Symbol Set}
    1.3 esc "(s1p14v0s3b4148T"
    {Proportional}
    {Point Size 14}
    {Upright}
    {Bold}
    {Typeface 4148}
    code "202" esc "&f0S" esc "&a20.25r70C" esc "(8U" esc "(s1p14v0s3b4148T"
    {Push Cursor Position}
    2.1 esc "&a20.25r70C"
    {Move to Row 20.25}
    {Move to Column 70}
    2.2 esc "(8U"
    {Roman-8 Symbol Set}
    2.3 esc "(s1p14v0s3b4148T"
    {Proportional}
    {Point Size 14}
    {Upright}
    {Bold}
    {Typeface 4148}
    code "211" esc "&f0S" esc "&f0y0X" esc "&l0E" esc "&a0L"
    esc "(0Q" esc "(s0p8.00h8.40s0b0T" esc "&k15H" esc "*p907Y" esc "&a13.8C"
    {Push Cursor Position}
    11.1 esc "&f0y0X"
    {Define Macro ID 0}
    {Start Macro Definition}
    11.2 esc "&l0E"
    {Define Top Margin at 0 Lines}
    11.3 esc "&a0L"
    {Define Left Margin at Column 0}
    11.4 esc "(0Q"
    {0Q Symbol Set}
    11.5 esc "(s0p8.00h8.40s0b0T"
    {Fixed Pitch}
    {pitch 8.00 cpi}
    {Font Style 8.40}
    {Medium Weight}
    {Typeface 0}
    11.6 esc "&k15H" esc "*p907Y"
    {Set HMI = 15/120"}
    {Vert position = 907 Dots}
    11.7 esc "&a13.8C"
    {Move to Column 13.8}
    code "212" esc "&f1x3x8X" esc "&f1S"
    {End Macro Definition}
    {Call Macro}
    {Delete Macro ID}
    12.1 esc "&f1S"
    {Pop Cursor Position}
    code "221" esc "&f0S" esc "*t300R" esc "*p1500X" esc "*p470Y"
    esc "(30C" esc "(4B" esc "(s1p53v0s0b102T!"
    esc "&f0S!" esc "&f1S" esc "*p+121Y" esc "&f1S"
    esc "&f0S"
    {Push Cursor Position}
    21.1 esc "*t300R"
    {300 DPI Graphics resolution}
    21.2 esc "*p1500X"
    {Horiz position = 1500 Dots}
    21.3 esc "*p470Y"
    {Vert position = 470 Dots}
    21.4 esc "(30C"
    {30C Symbol Set}
    21.5 esc "(4B"
    {4B Symbol Set}
    21.6 esc "(s1p53v0s0b102T!"
    {Proportional}
    {Point Size 53}
    {Upright}
    {Medium Weight}
    {Typeface 102}
    21.7 esc "&f0S!"
    {Push Cursor Position}
    21.8 esc "&f1S"
    {Pop Cursor Position}
    21.9 esc "*p+141Y"
    {Move down 121 Dots}
    21.10 esc "&f1S"
    {Pop Cursor Position}
    code "222" esc "&f0S" esc "*t300R" esc "*p1500X" esc "*p650Y"
    esc "(30A" esc "(s0p.426h35.25v0s0b128T" esc "&f0S!"
    esc "&f1S" esc "*p+141Y" esc "&f1S"
    {Push Cursor Position}
    22.1 esc "*t300R"
    {300 DPI Graphics resolution}
    22.2 esc "*p1500X"
    {Horiz position = 1500 Dots}
    22.3 esc "*p650Y"
    {Vert position = 650 Dots}
    22.4 esc "(30A
    {30A Symbol Set}
    22.5 esc "(s0p.426h35.25v0s0b128T"
    {Fixed Pitch}
    {pitch .426 cpi}
    {Point Size 35.25}
    {Upright}
    {Medium Weight}
    {Typeface 128}
    22.6 esc "&f0S!"
    {Push Cursor Position}
    22.7 esc "&f1S"
    {Pop Cursor Position}
    22.8 esc "*p+141Y"
    {Move down 141 Dots}
    22.9 esc "&f1S"
    {Pop Cursor Position}
    code "241" esc "&a-100V" esc "&l5.8C" esc "(8U" esc "(s0p12.00h10.00v0s3b3T" esc "&k11.75H"
    41.0 esc "&a-100V"
    {Move up 100 Decipoints}
    41.1 esc "&l5.8C"
    {Set VMI = 5.8/48"}
    41.2 esc "(8U"
    {Roman-8 Symbol Set}
    41.3 esc "(s0p12.00h10.00v0s3b3T"
    {Fixed Pitch}
    {pitch 12.00 cpi}
    {Point Size 10.00}
    {Upright}
    {Bold}
    {Typeface 3}
    41.4 esc "&k11.75H"
    {Set HMI = 11.75/120"}
    code "299" esc "(8U" esc "(s0p10.00h12.00v0s0b3T" esc "&k11.75H" esc "&l6D"
    {Roman-8 Symbol Set}
    99.1 esc "(s0p10.00h12.00v0s0b3T"
    {Fixed Pitch}
    {pitch 10.00 cpi}
    {Point Size 12.00}
    {Upright}
    {Medium Weight}
    {Typeface 3}
    99.2 esc "&k11.75H"
    {Set HMI = 11.75/120"}
    99.3 esc "&l6D"
    {6 LPI}

  • How i can make  my own connection in java source of a jsp page

    How i can make my own connection in java source of a jsp page (How to get connection from JNDI datasource address) ?
    imagine that i have a rowset in a web page , now i want to do some operation using
    plain JDBC , so i will need a connection object.
    I tried to get one of my rowsets connection but it return null ?
    what is best way to retrive a connection from JNDI datasource that we define for our project?
    for example if i have
    myRowSet.setDataSourceName("java:comp/env/jdbc/be");
    in web page constructor
    now i want a pure connection from the same datasource ? JNDI
    Thank you

    It is not hard to get your own connection from datasource.
    in your case you need to do like the the following code.
    i provide sample to show you how to catch the exception and create an statement .
    Connection con =null;
    try{
    InitialContext ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/be");
    con = ds.getConnection();
    java.sql.Statement st =con.createStatement();
    }catch(SQLException sqlex){
    sqlex.printStackTrace();
    sqlex.getNextException().printStackTrace();
    catch(NamingException nex){
    nex.printStackTrace();
    hth
    Masoud kalali

  • Call Oracle procedure with custom data type within Java and Hibernate

    I have a custom date TYPE in Oracle
    like
    CREATE TYPE DATEARRAY AS TABLE OF DATE;
    and I have a Oracle function also
    like
    CREATE OR REPLACE FUNCTION doesContain (list DATEARRAY, val VARCHAR2) RETURN NUMBER
    IS
    END doesContain;
    In my Java class,
    I have a collection which contain a list of java.util.Date objects
    When I call Oracle function "doesContain", how to pass my java collection to this Oracle function ...
    anyone can provide solutions?
    Please !!!
    Thanks,
    Pulikkottil

    Vu,
    First of all you need to define your types as database types, for example:
    create or replace type T_ID as table of number(5)Then you need to use the "oracle.sql.ARRAY" class. You can search this forum's archives for the term "ARRAY" in order to find more details and you can also find some samples via the JDBC Web page at the OTN Web site.
    Good Luck,
    Avi.

  • N00b query: Why would anyone ever want to define their own Exception class?

    I've been reading thru my Java textbook for the past couple hours.
    Exceptions are a wonderful thing. I already found several instances where I could've implemented try/cacth in my earlier programs.
    Anyway, getting back to the point. My question is, can someone give me a realistic situation/example where a custom Expcetion class is REQUIRED? (the key word here is "required"!)
    I can see why someone would want to have his own Exception class..... e.getMessage() as custom error messages are SO DAMN COOL!!!!!! :P
    hehe
    But seriously, if you are making intermidiate/advanced Java programs, would you ever REQUIRE to make your own Exception class? Afterall, even a custom made Exception class always "extends" from a pre-defined Java class, right?
    Let me make this a bit more clear... public class CustomException extends IOException{  }Now, if I am making a try/catch statement, I can simply say
    try{
    throw new CustomException;
    catch (IOException e) { }
    Now as you can see, the CustomException was caught by the catch claus, because IOException is the superclass of CustomException. So, in other words, the whole CustomException thingy didnt do anything useful.
    I know I know, I am so naive. Enlighten me >.<

    Sure. Say you want to have a system where you want to include a custom error code which maps to some internationalized error messages. You would create an Exception subclass with a field to hold that value separate from the normal "default" message. Then you could throw that exception in all your code. Other code can catch it as a plain Exception if they want and use the "default" message, which is okay if they don't really care about the error code.
    I don't think you are ever "required" to make your own exceptions. I have done so, but I don't often. It depends. See, there are plenty of Exception subclasses in the standard packages, and most of them cover many of the things you need. So more often if I'm throwing an exception, I'll be using the already existing ones, like IllegalArgumentException or IOException (whatever is relevant to the code).
    Yes, you can do what you did below with CustomException. However the reason you might do that is cuz you really want to do this:
    try {
       // call some code that may throw IOException from some standard IO package
       // or may throw CustomException from some of my methods...
    } catch (CustomException ce) {
       // handle cusotm exception
    } catch (IOException ioe) {
       // handle IO exception
    }Cuz you may want to differentiate between your exceptions vs. IOExceptions that might be thrown from some java.io class.
    Usually when you use an exception class it's a named class that relates to some condition. It may hold additional information besides the standard message, but I think most of the time it's just the class name which describes the problem. And if there isn't one that describes the problem that you're code might encounter, then create a subclass.

  • Possibility to have your own icons in JTree depending on what node

    Can you specify your own icons in a JTree? With this I mean more than your own directory/leaf icons. For example, if you have a family tree, you might want different icons for sons and daugthers etc.

    I did like you said, and it works, almost.
    I use the following code to find out what type my nodes in the tree are. I can just look at my NodeInfo object to get that. But when I click at different nodes in the tree, other nodes than the clicked one changes icons.
    DefaultMutableTreeNode node =
                   (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
              NodeInfo selectedNode = (NodeInfo)node.getUserObject();Edit: Also tried this code but that gave me:
    Exception in thread "main" java.lang.ClassCastException: java.lang.String
         at gui.MyTreeCellRenderer.getTreeCellRendererComponent(MyTreeCellRenderer.java:26)
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
              NodeInfo selectedNode = (NodeInfo)node.getUserObject();Message was edited by:
    sandsater

  • Define exchange rate types according to ledgers

    Hi Everyone,
    I am facing a problem about the exchange rate types.
    I want to set different exchange rate types for my leading ledger and local ledger.
    for example, the leading ledger 0L is defined for IFRS with default exchange rate type M.
    the local ledger LL is defined for our country China and i want to use own-defined exchange rate type say Y001.
    is it possible realize like this in SAP.
    thank you so much!
    regards,
    samson

    Hi, Samson:
    I am not sure whether it make sense to have different exchange rate for same two currencies in different countries, for example, in China and US, exchange rates for RMB and USD are different in same situation, like buy-in...
    Your question about exchange rate definition in Non-Leading Ledger - it is impossible to do that in Define and Activate Non-Leading Ledgers.
    For the purpose of Ledger approach for parallel accounting, it is used to meet the reporting requirements basically, for example, IFRS or USGAAP or HGB, but not for exchange rate type...
    If you get any surpurise information, please share with me. Thanks.
    Best Regards, Lawrence

Maybe you are looking for

  • Steps to Create a structure in  t.code se11

    hi, I want to know the steps to create a structure in se11. i want to include these fields: <u>Table</u>    <u>field</u> ekpo         -     ematn v_024        -     ektek ekko         -     verkf

  • Playing DVD using Java

    Hi expert(s), I am in progress of the development of a website, in which i need to play a DVD (extension with .IFO) in any way like giving a link or having a frame and playing the movie within it & etc, Is it Possible in java web application?, Any id

  • Is there any documentation on the BC Data Centre's?

    Hi, I have been a premium reseller of BC for over two years but I am struggling to find any documentation about the BC Data Centre's. I have not been asked before but I am launching a delegate Registration Microsite for Symantec and as with all large

  • LMS 3.2 Data purge

    Hello Dear's We have installed CS 3.2 and RME on 1 server on C: Drive. Now the problem is C: Drive is full with MB of space behind, when i went through the Cisco Works folder  i found location CSCOpx/files/rme/syslogpurgeddata files are occupying spa

  • Can't drag the divider of HDividedBox

    hello everyone, this is my code: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"       xmlns:s="library://ns.adobe.com/flex/spark"       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight