Help with large key performance

HI ,
I have a to build 3 Z DB table and in the table one of the field is (application ID )
is in size char 255 and it's table key (and i cant change this fields) .
the tables
Table 1
mandt type mandt     " key
user   type bname    " key
application_id type char255   " key
date...
Table 2
mandt type mandt     " key
user   type bname    " key
application_id type char255   " key
application_ver type char10   " key
additional fields (not keys).
Table 3
mandt type mandt     " key
user   type bname    " key
application_id type char255   " key
application_ver type char10    " key
app_additonl    type char50     " key
additional fields (not keys).
The problem is that when i activate the table i get warning of performance
since the key is larger then 120 charcter .
the table num 3 can have more than 1000000 recoreds .
and i can have lot of read access to the table
Regards
JOy

Hi ,
Do u suggest to use the calculate Hash for char with MD5 algorithm or SH1 ,or there is other recommended scenario  i that take the performance side in the picture too since the performance side is very impotent to my design .
or there is other ideas/ recommendation to my design?
Best Regards
Joy
Edited by: Joy Stpr on Jul 29, 2009 8:51 AM

Similar Messages

  • I need help with Creating Key Pairs

    Hello,
    I need help with Creating Key Pairs, I generate key pais with aba provider, but the keys generated are not base 64.
    the class is :
    import java.io.*;
    import java.math.BigInteger;
    import java.security.*;
    import java.security.spec.*;
    import java.security.interfaces.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import au.net.aba.crypto.provider.ABAProvider;
    class CreateKeyPairs {
    private static KeyPair keyPair;
    private static KeyPairGenerator pairGenerator;
    private static PrivateKey privateKey;
    private static PublicKey publicKey;
    public static void main(String[] args) throws Exception {
    if (args.length != 2) {
    System.out.println("Usage: java CreateKeyParis public_key_file_name privete_key_file_name");
    return;
    createKeys();
    saveKey(args[0],publicKey);
    saveKey(args[1],privateKey);
    private static void createKeys() throws Exception {
    Security.addProvider(new ABAProvider());
    pairGenerator = KeyPairGenerator.getInstance("RSA","ABA");
    pairGenerator.initialize(1024, new SecureRandom());
    keyPair = pairGenerator.generateKeyPair();
    privateKey = keyPair.getPrivate();
    publicKey = keyPair.getPublic();
    private synchronized static void saveKey(String filename,PrivateKey key) throws Exception {
    ObjectOutputStream out= new ObjectOutputStream(new FileOutputStream(filename));
    out.writeObject(key);
    out.close();
    private synchronized static void saveKey(String filename,PublicKey key) throws Exception {
    ObjectOutputStream out= new ObjectOutputStream( new FileOutputStream(filename));
    out.writeObject(key);
    out.close();
    the public key is:
    �� sr com.sun.rsajca.JSA_RSAPublicKeyrC��� xr com.sun.rsajca.JS_PublicKey~5< ~��% L thePublicKeyt Lcom/sun/rsasign/p;xpsr com.sun.rsasign.anm����9�[ [ at [B[ bq ~ xr com.sun.rsasign.p��(!g�� L at Ljava/lang/String;[ bt [Ljava/lang/String;xr com.sun.rsasign.c�"dyU�|  xpt Javaur [Ljava.lang.String;��V��{G  xp   q ~ ur [B���T�  xp   ��ccR}o���[!#I����lo������
    ����^"`8�|���Z>������&
    d ����"B��
    ^5���a����jw9�����D���D�)�*3/h��7�|��I�d�$�4f�8_�|���yuq ~
    How i can generated the key pairs in base 64 or binary????
    Thanxs for help me
    Luis Navarro Nu�ez
    Santiago.
    Chile.
    South America.

    I don't use ABA but BouncyCastle
    this could help you :
    try
    java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
    java.security.KeyPairGenerator kg = java.security.KeyPairGenerator.getInstance("RSA","BC");
    java.security.KeyPair kp = kg.generateKeyPair();
    java.security.Key pub = kp.getPublic();
    java.security.Key pri = kp.getPrivate();
    System.out.println("pub: " + pub);
    System.out.println("pri: " + pri);
    byte[] pub_e = pub.getEncoded();
    byte[] pri_e = pri.getEncoded();
    java.io.PrintWriter o;
    java.io.DataInputStream i;
    java.io.File f;
    o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pub64"));
    o.println(new sun.misc.BASE64Encoder().encode(pub_e));
    o.close();
    o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pri64"));
    o.println(new sun.misc.BASE64Encoder().encode(pri_e));
    o.close();
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.FileReader("d:/pub64"));
    StringBuffer keyBase64 = new StringBuffer();
    String line = br.readLine ();
    while(line != null)
    keyBase64.append (line);
    line = br.readLine ();
    byte [] pubBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
    br = new java.io.BufferedReader(new java.io.FileReader("d:/pri64"));
    keyBase64 = new StringBuffer();
    line = br.readLine ();
    while(line != null)
    keyBase64.append (line);
    line = br.readLine ();
    byte [] priBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
    java.security.KeyFactory kf = java.security.KeyFactory.getInstance("RSA","BC");
    java.security.Key pubKey = kf.generatePublic(new java.security.spec.X509EncodedKeySpec(pubBytes));
    System.out.println("pub: " + pubKey);
    java.security.Key priKey = kf.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(priBytes));
    System.out.println("pri: " + priKey);
    catch(Exception e)
    e.printStackTrace ();
    }

  • What init parameters will help with the OBIEE performance..?

    Hi All
    By any chance does any one have info on What init parameters will help with the OBIEE performance..?
    Thanks

    fast=true ;-)
    What performance is causing you a problem? Data retrieval, general UI navigation? Its a massive area to cover. Can you be more specific?

  • Help with larger sized voice wlan.... design considerations.... tips...etc...

    Hi Everyone,
         I'm hoping that you guys and gals can help me with an ongoing problem that we have at one of our sites. We're working on areas of the location due to it's size and phone load. We have an area, that I will refer to as building A, that is roughly a square that is 240' x 240'. The inside of the building has some pallets inside for storage(they allow RF to penetrate through them) and also some metal production lines. There is also a mezzanine  / elevated area in the middle that the users can walk under. It's not very large, but it would affect a phone if you walked underneath it while making a call. So, now that I have a brief description of the environment, I will tell you the equipment I'm running...
    1 x 4402 50AP Wireless Controller with 6.0.199.3 (MR3) installed.
    We currently have nine AP's installed in this area, with 4 up front so that way they cover the office areas better. Most are 1231G's, but some are 1242's.
    Since we do not have A radios everywhere (budgetary decision) we are running all of these phones on 2.4Ghz (Yikes! I know!)
    The 7920's use LEAP and the 7921's use PEAP MS-CHAP v2 with CCKM enabled on the controller.
    I also have 802.1p wired QoS enabled for the voice QoS profile and it is applied to our voice WLAN.
    We have conference rooms in the front area that will need to support roughly 20-30 maximum mixed 7920 and 7921G phones in a roughly small area. (Yikes! I know!)
    We also have a 2106 with mesh .54M installed, but it is for outdoor AP's and should not be affecting this area.
    So, I guess my questions are....
    Has anyone ever operated the 7920 and 7921G's in mixed mode?
    I'm thinking about separating the 7920s on 2.4 and tell the 7921's to prefer the A band or just use A. This will require A radios / surgery, but we've dealt with different code trains, TAC configs, and even added a few more radios. I think it's time to say we need to redesign this area. It doesn't help that phones keep getting purchased either....
    What rule of thumb would you guys / gals say would be appropriate for this phone count in terms of the number of AP's I should use?
    Since we're dealing with two different phone models, it makes it hard to simply just read the deployment guide. I know these phones can coexist, I just think we're running into over capacity and problems with 802.11B in the mix. In the conf room right now, there are most likely signals from at least two AP's. This doesn't seem like enough bandwidth for just the 2.4 Ghz range when 20 - 30 phones are in there. Not all of them are calling, but the associations / mgmt traffic alone must be horrendous since the phones are 802.11B
    We are going to do a manual survey with a 1242 since that AP will support both phone models. I think we may need to survey twice if we're going to go this route; One survey for the 7920's on 2.4Ghz with a 1242AG and one survey on 5Ghz with a 7921G. I think that will provide the info we need to get the AP's repositioned where they need to be.
    What kind of power levels should I be using in an area like that? We've originally had a survey at 50mW, but since then we turned the power down to pwr lvl 3 in some spots due to the additional AP's. I've seen references of roughly 1 AP per 3000 sq. ft at pwr level 4, but that seems overkill. 
    Can we run mixed power levels on AP's with the phones? Or will that cause one way audio due to the transmit power diffrences in the cells?
    I'm thinking that we should pick a power level, survey the -67 cell size at the power level, add more AP's so that way they are overlapped 15-20%, and then actually implement the design. I'm pretty good at getting decent channel assignments in place. I know of non-overlapping channels, RRM, etc. I also have an AirMagnet laptop with an Aironet Adapter. It is good for finding noise, interference, etc...
    I understand this is practically a book, but at this point, we've been trying a LOT of different things in order to get this to work properly. I think it's finally time for me to "strongly suggest" that we do the following...
    1. Choose ONE phone model.
    2. Choose ONE AP model.
    3. Make sure to implement the 5Ghz band for all AP's so we have complete coverage.
    4. Choose ONE power level for each band. This will affect the coverage and placement of AP's. I'd imagine that we'd need to survey with A first, and then survey with b/g. Typically we can use the 1242 and get about the same cell size on both bands, but 5Ghz is a higher frequency and may not penetrate as much as 2.4 Ghz..
    5. Come up with a new coverage map based on a manual site survey with the phones mentioned above.
    6. Implement the design.
    7. Use it.
    8. Try not to have a heart attack when the system actually supports that many phones in that area...
    So, please, let me know your thoughts and if you have any suggestions. It would be greatly appreciated. We've been slowly working out the gremlins in the phones there over the past few years. I'm more of a data wireless person myself, but I do have good luck with a low to moderate phone count (usually no more than 7 calls per AP). Once we start doing craziness like trying to get 20-30 802.11B phones to work in the same area on only one or two AP's, then things start to become a challenge, especially when we don't have the 5Ghz cells to help with the bandwidth requirements for voice....
    Thank you for your time,
    Craig 

    There's a pretty recent (last few months) Voice over Wlan design guide published (was published for the 9971 phones - but all great advice) and it recommends just about all the settings required for an off the shelf wireless voice network.
    http://www.ciscosystems.com/en/US/docs/voice_ip_comm/cuipph/9971_9951_8961/7_1_3/english/deployment/guide/9971dply.pdf

  • Help with Unique Key Insert!!!

    I need help with this <<removed by moderator>>
    When i try to do an insert "A" into a DB table, the transaction fills the info on creation mode, but is not doing the same at modification mode.
    Here i send the insert, i don't if the problems comes from sintaxis:
    INSERT zpsprctr_det FROM TABLE it_planif ACCEPTING DUPLICATE KEYS.
    tabal base datos es la zpsprctr_det
    Any ideas please let me know
    Moderator Message: Gun-to-the-head-deadline removed
    Edited by: kishan P on Mar 31, 2011 12:24 PM

    Hi,
    with
    INSERT dbtable FROM TABLE itab ACCEPTING DUPLICATE KEYS.
    you will insert several lines in a database table from an internal table. Duplicate keys are ignored, the 1st entry is written.
    To update them, you should use
    MODIFY dbtable FROM TABLE itab.
    This updates all lines that are existing or inserts all lines that are still missing.  If you have duplicate keys here, the last entry will do the last update.
    Regards,
    Klaus

  • Color printing help with large graphics Reader 11.0.3

    Good morning!  We recently upgraded to 11.0.3.  Windows 7 64-bit.  We've had issues printing large color graphics from Reader 11.
    For example, the PDF will have an intricate purple graphic with matching purple text blocks underneath.  Print preview shows correctly, but when printed the graphic prints brown instead of purple.  The purple text blocks print correctly.  This seems to happen sporadically, but seems to be with complex graphics.
    Documents from all other apps print OK and if we open this .pdf from Acrobat X Standard and export it to a .png file the colors print correctly. 
    The graphic files come from a myriad of sources and customers and we don't have control over the way the documents are originally saved or what apps are used to create the artwork. 
    Any idea why the graphics colors aren't printing and if there are settings we can adjust in Reader 11 so they will print correctly?
    We've tried:
    - Printing to several printers with different drivers and all yield the same results.  (Toshiba eStudio 3530c with PCL6 and PS drivers, Epson Artisan 835, HP OfficeJet 8600, Samsung CLX-6200x)
    - Adjusting the Overprint Preview settings under File -> Preferences and setting "Simulate Overprinting" under the Advanced button in the print preview window.
    - Selecting "Print As Image" under the Advanced button in the print preview window.
    - Adjusting the Document Color Options under File -> Preferences -> Accessibility.
    Thanks in advance for any help!

    Fastest thing you can try: use Windows Explorer to navigate to C:\Program Files (x86)\Adobe\Reader 11.0\Reader, then double-click on Eula.exe and accept the license agreement.
    If that doesn't work, you can try using this tool to first remove all traces of Reader from your computer:
    http://labs.adobe.com/downloads/acrobatcleaner.html
    Then, you can download the full offline Reader installer from
    http://get.adobe.com/reader/enterprise/
    After downloading, restart your computer and run the installer before doing anything else.

  • Help with large import to Lightroom

    I have about 15000 images in 100's of folders to import into Lightroom; tech assistance tells me I must import each folder one at a time; please tell me there is a faster way for such a large import.  Thanks in advance, Mirlie

    I beg your pardon.  You are absolutely right (as, I am sure you had no doubt).  I was clicking choose instead of import all photos in selected folders; as a matter of fact until I just read you response I had not ever seen the option of "import all photos in selected folders".  Again so sorry to have indicated your solution was wrong.  It amazes me that I have spent hours on the phone with Adobe LR tech support and they continued to read from their scripts that I needed to import each folder individually.  You have saved me many hours and stiff shoulder muscles.  I now know where to come for help.  Have a great evening.  Thanks so much.

  • No primary key in database table.Need help with ODS keys.

    Hi ,
    I am pulling data from a database table where there in no primary key . So when I designed my ODS and loaded the data , the records got overwritten...(If there are 5000 records only 4000 got transfered) . So Now the only option I can think of is putting all the database fields as key fields in my ODS but then I am restricted to only 16 fields for ODS and I have more than 24 fields in my database table.What should I do now.Any help will be appreciated.
    Thanks a lot!!!

    Hi,
    are you trying to pull data from structures.....putting all the fields in the key fields is the ODS keys is not a solution.
    what is your reporting requirement....try to maintain the keys for which you want to see the data
    e.g. if in report you want to see the data for sales order then put the keys as sales order for ODS...so that the data is correct at the sales order level.
    ie. the try to maintain the ODS at the level ...which can be used.
    This is the just a guide....you can decide with your requirement.
    Thanks

  • Help with understanding key event propagation

    Hello,
    I am hoping someone can help me understand a few things which are not clear to me with respect to handling of key events by Swing components. My understanding is summarized as:
    (1) Components have 3 input maps which map keys to actions
    one for when they are the focused component
    one for when they are an ancestor of the focused component
    one for when they are in the same window as the focused component
    (2) Components have a single action map which contains actions to be fired by key events
    (3) Key events go to the currently focused component
    (4) Key events are consumed by the first matching action that is found
    (5) Key events are sent up the containment hierarchy up to the window (in which case components with a matching mapping in the WHEN_IN_FOCUSED_WINDOW map are searched for)
    (6) The first matching action handles the event which does not propagate further
    I have a test class (source below) and I obtained the following console output:
    Printing keyboard map for Cancel button
    Level 0
    Key: pressed C
    Key: released SPACE
    Key: pressed SPACE
    Level 1
    Key: pressed SPACE
    Key: released SPACE
    Printing keyboard map for Save button
    Level 0
    Key: pressed SPACE
    Key: released SPACE
    Level 1
    Key: pressed SPACE
    Key: released SPACE
    Printing keyboard map for Main panel
    Event: cancel // typed SPACE with Cancel button having focus
    Event: save // typed SPACE with Save button having focus
    Event: panel // typed 'C' with panel having focus
    Event: panel // typed 'C' with Cancel button having focus
    Event: panel // typed 'C' with Save button having focus
    I do not understand the following aspects of its behaviour (tested on MacOSX although I believe the behaviour is not platform dependent):
    (1) I assume that the actions are mapped to SPACE since the spacebar clicks the focused component but I don't explicitly set it?
    (2) assuming (1) is as I described why are there two mappings, one for key pressed and one for key released yet the 'C' key action only has a key pressed set?
    (3) assuming (1) and (2) are true then why don't I get the action fired twice when I typed the spacebar, once when I pressed SPACE and again when I released SPACE?
    (4) I read that adding a dummy action with the value "none" (i.e. the action is the string 'none') should hide the underlying mappings for the given key, 'C' the my example so why when I focus the Cancel button and press the 'C' key do I get a console message from the underlying panel action (the last but one line in the output)?
    Any help appreciated. The source is:
    import javax.swing.*;
    public class FocusTest extends JFrame {
         public FocusTest ()     {
              initComponents();
              setTitle ("FocusTest");
              setLocationRelativeTo (null);
              setSize(325, 160);
              setVisible (true);
         public static void main (String[] args) {
              new FocusTest();
    private void initComponents()
         JPanel panTop = new JPanel();
              panTop.setBackground (java.awt.Color.RED);
    JLabel lblBanner = new javax.swing.JLabel ("PROPERTY TABLE");
    lblBanner.setFont(new java.awt.Font ("Lucida Grande", 1, 14));
    lblBanner.setHorizontalAlignment (javax.swing.SwingConstants.CENTER);
              panTop.add (lblBanner);
              JPanel panMain = new JPanel ();
              JLabel lblKey = new JLabel ("Key:");
              lblKey.setFocusable (true);
              JLabel lblValue = new JLabel ("Value:");
    JTextField tfKey = new JTextField(20);
    JTextField tfValue = new JTextField(20);
    JButton btnCancel = new JButton (createAction("cancel"));     // Add a cancel action.
    JButton btnSave = new JButton (createAction("save"));          // Add a sve action.
              panMain.add (lblKey);
              panMain.add (tfKey);
              panMain.add (lblValue);
              panMain.add (tfValue);
              panMain.add (btnCancel);
              panMain.add (btnSave);
              add (panTop, java.awt.BorderLayout.NORTH);
              add (panMain, java.awt.BorderLayout.CENTER);
    setDefaultCloseOperation (javax.swing.WindowConstants.EXIT_ON_CLOSE);
    // Add an action to the panel for the C key.
              panMain.getInputMap (JComponent.WHEN_IN_FOCUSED_WINDOW).put (KeyStroke.getKeyStroke (java.awt.event.KeyEvent.VK_C, 0), "panel");
              panMain.getActionMap ().put ("panel", createAction("panel"));
              // FAILS ???
              // Add an empty action to the Cancel button to block the underlying panel C key action.
    btnCancel.getInputMap().put (KeyStroke.getKeyStroke (java.awt.event.KeyEvent.VK_C, 0), "none");
    // Print out the input map contents for the Cancel and Save buttons.
    System.out.println ("\nPrinting keyboard map for Cancel button");
    printInputMaps (btnCancel);
    System.out.println ("\nPrinting keyboard map for Save button");
    printInputMaps (btnSave);
              // FAILS NullPointer because the map contents are null ???
    System.out.println ("\nPrinting keyboard map for Main panel");
    // printInputMaps (panMain);
    private AbstractAction createAction (final String actionName) {
         return new AbstractAction (actionName) {
              public void actionPerformed (java.awt.event.ActionEvent evt) {
                   System.out.println ("Event: " + actionName);
    private void printInputMaps (JComponent comp) {
         InputMap map = comp.getInputMap();
         printInputMap (map, 0);
    private void printInputMap (InputMap map, int level) {
         System.out.println ("Level " + level);
         InputMap parent = map.getParent();
         Object[] keys = map.allKeys();
         for (Object key : keys) {
              if (key.equals (parent)) {
                   continue;
              System.out.println ("Key: " + key);
         if (parent != null) {
              level++;
              printInputMap (parent, level);
    Thanks,
    Tim Mowlem

    Use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.
    1) In the Metal LAF the space bar activates the button. In the Windows LAF the Enter key is used to activate the button. Therefore these bindings are added by the LAF.
    2) The pressed binding paints the button in its pressed state. The released binding paint the button in its normal state. Thats why the LAF adds two bindings.
    In your case you only added a single binding.
    3) The ActionEvent is only fired when the key is released. Same as a mouse click. You can hold the mouse down as long as you want and the ActionEvent isn't generated until you release the mouse. In fact, if you move the mouse off of the button before releasing the button, the ActionEvent isn't even fired at all. The mouse pressed/released my be generated by the same component.
    4) Read (or reread) the [url http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html#howto]How to Remove Key Bindings section. "none" is only used to override the default action of a component, it does not prevent the key stroke from being passed on to its parent.

  • Please help with Posting Keys For Fast Entry (t.code OBXJ)

    Dear experts,
    Please help me to be more familiar with configurtation of Enjoy Transactions (t.code OBXJ). I want to configure fast entry transaction and change standard assignement of posting key. But there are no editing options in this transaction, just three transaction keys are predefined and posting keys are assigned to them (those are changable). But where to see what those transaction keys mean? And what could be your proposals, how to configure this IMG step?
    Thanks!

    Hi,
    t.code OBXJ is for automatccly postings, normal you never change the standard posting keys.
    In the block line items you can select colums you need and place the one's you need to the begin of the screen and in the right top corner of posting line items you can click an save this as (default) variant.
    When you want to use an other posting keys you use the option complex posting (F6)
    Paul

  • Need help with capturing live performance with 2 cameras

    I captured a live performance with two different cameras, one was AVCHD the other in DV. In Adobe, is there a way to down convert the large AVCHD to match the HD so that I can do a multi-camera edit? Here are the specs of the videos
    Here are the two camera specs:
    Type: AVI Movie
    File Size: 5.7 GB
    Image Size: 720 x 480
    Pixel Depth: 32
    Frame Rate: 29.97
    Source Audio Format: 48000 Hz - 16 bit - Stereo
    Project Audio Format: 48000 Hz - 32 bit floating point - Stereo
    Total Duration: 00;26;58;23
    Average Data Rate: 3.6 MB / second
    Pixel Aspect Ratio: 0.9091
    and
    Type: MPEG Movie
    File Size: 1.9 GB
    Image Size: 1920 x 1080
    Pixel Depth: 32
    Frame Rate: 29.97
    Source Audio Format: 48000 Hz - compressed - Stereo
    Project Audio Format: 48000 Hz - 32 bit floating point - Stereo
    Total Duration: 00:16:04:02
    Average Data Rate: 2.0 MB / second
    Pixel Aspect Ratio: 1.0

    I don't do HD, but a couple of saved links
    Convert AVCHD to HDV http://forums.adobe.com/thread/390605?tstart=0
    Tutorial HD to SD w/CS4 http://bellunevideo.com/tutorials/CS4_HD2SD/CS4_HD2SD.html

  • Help with Large Flat Hierarchies

    I'm building a cube with 7 dimensions. 4 are sparse and 3 of those are large and flat (2-4 levels deep) Member Counts: 3K,9K,12K in those. Performance is not good to say the least. Playing with hash table options - any other advice?

    Performance in the calc or retrievals or both? Please provide more information.

  • Help with  On key press and Frame

    Hi everybody,
    I have been trying to make this work but not able to. It would be of great help if u can tell where i am going wrong. Here is my code ( it is prety small) :
    I am trying to draw a random line when i do a keypress on the text field.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    public class KeyPress extends Frame{
    Label label;
    TextField txtField;
    public static void main(String[] args) {
    KeyPress k = new KeyPress();
    public KeyPress(){
    super("Key Press Event Frame");
    Panel panel = new Panel();
    label = new Label();
    txtField = new TextField(20);
    txtField.addKeyListener(new MyKeyListener());
    add(label, BorderLayout.NORTH);
    panel.add(txtField, BorderLayout.CENTER);
    add(panel, BorderLayout.CENTER);
    addWindowListener(new WindowAdapter(){
    public void windowClosing(WindowEvent we){
    System.exit(0);
    setSize(400,400);
    setVisible(true);
    public class MyKeyListener extends KeyAdapter{
    public void keyPressed(KeyEvent ke){
    char i = ke.getKeyChar();
    String str = Character.toString(i);
    label.setText(str);
    Line2D myLine = new Line2D.Double(5,5,100,100);
    }

    Here's what I come up when I played with your code.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.util.Random;
    public class KeyPress extends Frame {
        TextField txtField;
        Panel panel;
        public static void main(String[] args) {
            KeyPress k = new KeyPress();
        public KeyPress(){
            super("Key Press Event Frame");
            panel = new myCanvass();
            txtField = new TextField(20);
            txtField.addKeyListener(new MyKeyListener());
            panel.setBackground(Color.LIGHT_GRAY);
            add(txtField, BorderLayout.PAGE_END);
            add(panel, BorderLayout.CENTER);
            addWindowListener(new WindowAdapter(){
                public void windowClosing(WindowEvent we){
                    System.exit(0);
            setSize(400,400);
            setVisible(true);
        class myCanvass extends Panel {
            private Graphics2D g2;
            public void paint(Graphics g) {
                drawLine(g);
            private void drawLine(Graphics g) {
                g2 = (Graphics2D) g;
                g2.setColor(Color.RED);
                g2.draw(new Line2D.Double(Math.random() * 150, Math.random() * 150, Math.random() * 200, Math.random() * 200));
        class MyKeyListener extends KeyAdapter{
            public void keyPressed(KeyEvent ke){
                char i = ke.getKeyChar();
                String str = Character.toString(i);
                panel.repaint();
    }

  • Search help with multiple key fields

    Hi,
    I want to dispaly search help on a field from a internal table have multiple key fields i.e combination of fld1 + fld2 +fld3 makes one single row. Therfore can any one tell me how to return that single row , because if I am using function F4IF_INT_TABLE_VALUE_REQUEST I get only one return field that I select by which I can't get the actual line that I have selected as there may be more that one line for that field.
    please suggest any way through programming not by creating any search help through se11.
    thanks

    Hi,
    Use select query to select the fields & display them.
    In the following code i've selected only a single field in select query but u can do it for more than 1 & proceed similarly.i've tried it before using this code.
    SELECT WERKS
             NAME1
             FROM T001W
             INTO TABLE ITEMP
             WHERE IWERK = 'M011'.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                  DDIC_STRUCTURE   = ' '
                RETFIELD         = 'WERKS'
                  PVALKEY          = ' '
                  DYNPPROG         = ' '
                  DYNPNR           = ' '
                  DYNPROFIELD      = ' '
                  STEPL            = 0
                  WINDOW_TITLE     =
                  VALUE            = ' '
               VALUE_ORG        = 'S'
                  MULTIPLE_CHOICE  = ' '
                  DISPLAY          = ' '
                  CALLBACK_PROGRAM = ' '
                  CALLBACK_FORM    = ' '
           TABLES
                VALUE_TAB        = ITEMP
                  FIELD_TAB        =
               RETURN_TAB       = T_RETURN
                  DYNPFLD_MAPPING  =
             EXCEPTIONS
                  PARAMETER_ERROR  = 1
                  NO_VALUES_FOUND  = 2
                  OTHERS           = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      S_WERK-LOW = T_RETURN-FIELDVAL.
    Hope this helps.
    Reward if helpful.
    Regards,
    Sipra

  • Need help with generating keys from xml

    Hello,
    I am just learning about JCE and am haveing some problems with implementing a basic program.
    I have the following information:
    <RSAKeyValue>
    <Modulus>Base64EncodedString</Modulus>
    <Exponent>Base64EncodedString</Exponent>
    <P>Base64EncodedString</P>
    <Q>Base64EncodedString</Q>
    <DP>Base64EncodedString</DP>
    <DQ>Base64EncodedString</DQ>
    <InverseQ>Base64EncodedString</InverseQ>
    <D>Base64EncodedString</D>
    </RSAKeyValue>
    From which I need to construct a public and private key. I am using RSA algorithm for the encrypting and decrypting. I am using the org.bouncycastle.jce.provider.BouncyCastleProvider provider. Any help would be greatly appreciated.
    My questions are:
    1) Is it possible to create the public and private key from this data?
    2) How can I construct a public and private key from this data.
    Thank you in advance.
    Sunit.

    Thanks for your help...I am still having problems.
    I am now creating the public and private keys. I am generating the public exp, modulus, private exp, and the encrypted text from another source.
    so my questions are:
    1) How do I verfiy that the private and public keys that I generate are valid?
    2) How do I get the decrypted text back in a readable form?
    3) the decrypted text should read "ADAM"
    Here is a test I wrote:
    _________________STARTCODE_____________________
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.math.BigInteger;
    import org.bouncycastle.jce.provider.BouncyCastleProvider;
    public class CryptTester
         protected Cipher encryptCipher = null;
         protected Cipher decryptCipher = null;
         private KeyFactory keyFactory = null;
         protected PublicKey publicKey = null;
         protected PrivateKey privateKey = null;
         private RSAPublicKeySpec publicKeySpec = null;
         private RSAPrivateKeySpec privateKeySpec = null;
         public CryptTester()
              /* Create Cipher for asymmetric encryption (
              * e.g., RSA),
              try
                   encryptCipher = Cipher.getInstance("RSA", "BC");
                   System.out.println("Successfully got encrypt Cipher" );
                   decryptCipher = Cipher.getInstance("RSA", "BC");
                   System.out.println("Successfully got decrypt Cipher" );
                   keyFactory = KeyFactory.getInstance("RSA" , "BC");
                   System.out.println("Successfully got keyFactory" );
              }catch ( NoSuchAlgorithmException nsae)
                   System.out.println("Exception1: " + nsae.toString() );
              catch ( NoSuchPaddingException nspe)
                   System.out.println("Exception2: " + nspe.toString() );
              catch ( java.security.NoSuchProviderException nspe)
                   System.out.println("Exceptiont6: " + nspe.toString() );
              /* Get the private and public keys specs
              BigInteger publicMod = new BigInteger ("86e0ff4b9e95bc6dcbfd6673b33971d4f728218496adcad92021923a9be815ddb7ecf17c06f437634c62fa999a293da90d964172a21d8ce74bd33938994fbd93377f7d83ce93d523782639c75221a3c91b53927a081b2b089a61770c6d112d78d5da8a6abc452d39a276787892080d6cf17dd09537c1ec5551d89567345068ef", 16);
              BigInteger publicExp = new BigInteger ("5");
              BigInteger privateExp = new BigInteger ("50ed65fa2bf3710ead980a456b88dde62de4e0e9", 16);
              publicKeySpec = new java.security.spec.RSAPublicKeySpec( publicMod, publicExp );
              privateKeySpec = new java.security.spec.RSAPrivateKeySpec( publicMod, privateExp);
              try
                   privateKey = keyFactory.generatePrivate(privateKeySpec);
                   publicKey = keyFactory.generatePublic(publicKeySpec);
              }catch ( InvalidKeySpecException ivse)
                   System.out.println("Exception3: " + ivse.toString() );
              try
              * initialize it for encryption with
              * recipient's public key
                   encryptCipher.init(Cipher.ENCRYPT_MODE, publicKey );
                   decryptCipher.init(Cipher.DECRYPT_MODE, privateKey );
         }catch ( InvalidKeyException ivse)
                   System.out.println("Exception4: " + ivse.toString() );
         public String getPublicKey()
              //return new String(publicKey.getEncoded());
              return publicKey.toString();
         public String getPrivateKey()
         //          return new String(privateKey.getEncoded());
              return privateKey.toString();
         public String encryptIt(String toencrypt)
              * Encrypt the message
              try
                   byte [] result = null;
                   try
                        result = encryptCipher.doFinal(toencrypt.getBytes());
                   catch ( IllegalStateException ise )
                        System.out.println("Exception5: " + ise.toString() );
                   return new String(result);
              }catch (Exception e)
                   e.printStackTrace();
              return "did not work";
         public String decryptIt(String todecrypt)
                        * decrypt the message
              try
                   byte [] result = null;
                   try
                        result = decryptCipher.doFinal(todecrypt.getBytes());
                   catch ( IllegalStateException ise )
                        System.out.println("Exception6: " + ise.toString() );
                   return new String(result);
              }catch (Exception e )
                   e.printStackTrace() ;
              return "did not work";
         public static void main(String[] args)
              try
              Security.addProvider(new BouncyCastleProvider());
              CryptTester tester = new CryptTester();
              String encrypted = "307203c3f5827266f5e11af2958271c4";
              System.out.println("Decoding string " + encrypted + "returns : " + tester.decryptIt(encoded) );
              } catch (Exception e)
                   e.printStackTrace();
    _________________ENDPROGRAM_____________________

Maybe you are looking for

  • How to change the fonts (permanently) for new (empty) documents in pages

    I am searching for a way to change the settings/preferences of Pages / Numbers and Co such, that the standard font is not Helvetic, but a font of my choice. I am used to this from the MS Office products in my job, but want to keep my Mac "clean" and

  • HTML email in Lotus Notes 4.6.7

    Sorry if this question has been asked before. A quick search found quite a few Lotus Notes related topics, but nothing specific to my problem. I have an HTML email which looks fine in Microsoft Outlook, but which looks hideous in Lotus Notes 4.6.7. C

  • SERIOUS BUS BUG

    Try this: put audio on tracks 1, 2, 3. set tracks 1, 2, 3 output to Bus2 MUTE Bus2. You are still hearing the audio on tracks 1, 2, and 3 ! (you definitely should not be hearing anything) Here's the killer though: Now UnMute Bus2 and notice that the

  • Investment Order data not picking

    Hi all, I am not able to trace the date of the Investment Order in the Asset master data.... I have made the IO has the optional in the Asset Master data in the Screen layout... eventhough it is not capturing the data..... what could be the reason?..

  • Dbstart command

    i issued a dbstart as oracle user in solaris, and the 3 instances started alright. For some reason having connect as sysdba with sqlplus, i still get ORA-01034. 1. i need to shutdown down the instance 2. possibly see if i can resolve the ORA-01034 er