How to store additional info in an attribute_column ?

Hey guys,
I'd like to use one of the attribute columns in the RA_CUSTOMER_TRX_LINES_ALL table to store additional information for my package. So how is it done ? Do I just insert the values into the chosen attribute column using INSERT INTO TABLE_NAME(attribute_column) VALUES(variable) ? or should I go first under the application developer responsibility and register the DFF as it's done with forms ?
Thanks

You can use sql to populate the tables but you should still register the DFF in Apps. Also, registering it in Apps will let users view the data as necessary.

Similar Messages

  • How data stores in info object

    Hi all
    How can an Infoobject characteristic created without master data and texts.And in same wayi need to store the data in the infoobject
    regards
    ashwin

    Hi Ashwin,
    Normally while creating(Activating) info object in background tables has been created for each one.
    Suppose for example you IO name is like this ZIO_MID
    for this info object the Master data table will be like this,
    /BIC/MZIO_MID --> Master data view
    /BIC/PZIO_MID --> Time independent object
    /BIC/QZIO_MID --> Time dependent object
    For SID tables will be created like this,
    /BIC/SZIO_MID --> SID table view
    /BIC/XZIO_MID --> Time independent sid object
    /BIC/YZIO_MID --> TIme dependent object
    For this object Text table will be created like this,
    /BIC/TZIO_MID --> Text table view
    you can directly enter these table name in SE11 and you can directly insert your values also.
    While creating infoobject you can unselect those options of "WIth Master data" and " With Texts" .
    If you want to maintain data within this objects , Right click your info object maintain master data and execute and click create button , Insert your values.
    NOTE: Assign points if it helps
    Regards,
    Arun.M.D

  • How to Get Additional Info from LDAP

    I have an application that is using LDAP authentication. Its working great but I would like to know if its possible to extract additional information about the user at the the point of authentication. For example when the user logs in and is authenticated it would be nice to be able to get their email address, phone, etc. at that time. Is this possible with the existing authentication scheme? I didn't see anything mentioned in the Help text.
    Thanks.
    David

    Tom,
    Have a look at the code I posted in this thread -
    Re: help with htmldb_ldap.is_member function
    Whilst that thread is more related to using the is_member function, the code I posted shows how you can query the attributes for a particular DN in an LDAP server.
    So....I don't want to put the cart before the horse, but if it helps your case to make Apex (as it's known now rather than HTMLDB) "the winner", then I would stress that this feature is definitely achievable (but how difficult it is will depend on your exact requirements).
    In short....definitely do-able....

  • How to store personal data in two different languages

    Hello,
    as usual we're storing employee's personal data in the infotype 0002, but suppose we need to store this information (for instance the name) in two different languages with also two different alphabets (for instance english and russian, chinese, etc.) As far as I know you cannot store data in the infotype depending on the language, and for infotype 0002 there are no subtypes available, so what is the solution provided by SAP if you need to store information in two different languages?
    Kind regards,

    Hello Raj,
    first of all thank you very much for your answer, it's in fact a good idea, but what if I need to store the information both in English and Greek, if I create a new screen for Greek employees (lets say) they are only going to enter the info in greek language, what about the english info?
    I don't want to create two registers in infotype 0002, I think it will be a better idea if we had an infotype to store additional info in other languages, take into account that we'll probably need other fields like family members names and so on
    Thanks again

  • How to verify payment info on itunes store? i want to rent movien on apple TV

    i want to rent movies  on my apple tv but.. how to verify payment info on itunes store?

    This same thing happened to me several times.
    Finally, I tried checking my credit card info in iTunes on my computer, and when I went in to edit it, I had to enter in my Credit Card Security Code again. There was a box next to it that said something about needing to re-enter the number since my account was being accessed from a new device. So, I entered my Security Code, tried the purchase again from my Apply TV, and it worked great.
    Hope that helps.

  • HT1541 How to reset additional account info

    I just got a new phone after water damage and I'm trying to bye music and iTunes requires additional info for the account , for the first purchase on a device and I don't remember the Info. How do I rest.

    You won’t be able to see this option if you are searching an object. 
    You need to go to the actual object and open the properties to see the complete tab/options. 
    It is by design!
    Santhosh Sivarajan | Houston, TX
    http://www.sivarajan.com/
    This posting is provided AS IS with no warranties,and confers no rights.

  • TS4009 I store important info in my notes app that I refer daily to. Some of my notes have 'disappeared' from my notes list and I cannot find them. Any ideas how to retrieve my lost notes?

    I store important info in my notes app on my Iphone 4S that I refer to daily. Some of my notes have 'disappeared' from my notes app.  Any ideas how to retrieve my lost notes. I am up to date on my software. All notes are  backed up to Icloud. I have approximately 74 notes on my iphone  but Icloud is showing only 15!

    Hi iPheariPhoPad,
    Welcome to Apple Support Communities.
    It sounds like there’s an issue with Settings, the Notes app entry isn’t showing up as expected. Take a look at the article linked below and try restarting your iPhone 3GS.
    Restart or reset your iPhone, iPad, or iPod touch - Apple Support
    If that doesn’t do it, try restoring your iPhone as shown in this article:
    Use iTunes to restore your iOS device to factory settings - Apple Support
    Take care,
    -Jason

  • Does this all in one store any info and if so how do I delete it. I'm giving it away.

    I have a HP Officejet Pro 8600 Plus all in one. I'm giving it away and wanted to know does it store any info and if so can I delete it? I already deleted my fax recored. It's mostly been used for scanning to my laptop and printing.

    The fax setup and fax logs would be the only personal information that would remain in the printer after the power is removed.  Make sure you do not have any camera card left in the slots in the lower left front of the printer.

  • How to store numbers in a stack....

    hello guys...i ve got the following assignment:
    Write a Java program that reads and evaluates a fully parenthesised arithmetic expression. The
    purpose of this program is to illustrate a fundamental use of stacks. Implement the stack using
    Linked Lists as explained in your notes.
    For e.g if a user enters the expression: (((6 + 9) / 3) * (6 � 4))
    The result should be 10.
    Your program should be properly documented and well structured. Specifications should be
    clearly written in your logbook for all the methods, constructors, and classes that you implement
    in the following format:
    Class / Method/ Constructor name explaining what it does
    Parameters
    Preconditions
    Postconditions
    Throws
    Now, i ve come up with the following code:
    import java.util.EmptyStackException;
    class StackNode {
         private static Object data;
         private StackNode link;
         private static StackNode head;
         private int totalnodes;
    // the constructors
    public StackNode(Object obj, StackNode lk)
         data = obj;
         link = lk;
    public StackNode()
         head = null;
         totalnodes = 0;
         // the push method
         public void push(Object obj)
              head = new StackNode(obj, head);
              totalnodes++;
         // the pop method
         public Object pop()
              Object answer;
              if(head == null)
                   throw new EmptyStackException();
              answer = head.getData();
              head = head.getLink();
              totalnodes--;
              return answer;
         // the isEmpty method
         public boolean isEmpty()
              return (head == null);
         // get data
         public Object getData()
              return data;
         // get link
         public StackNode getLink()
              return link;
         // size or length method
         public int size()
              return totalnodes;
         public static void main (String args [])
              int i;
              StackNode number = new StackNode();
              StackNode operator = new StackNode();
              head = new StackNode(data, head);
              number.push(new Integer(9));
              number.push(new Integer(6));
              operator.push(new Character('+'));
    and i dont know how to store numbers into the stack and how to use the operations such as addition substraction division and multiply...
    any ideas how to do that??
    cheers....

    This doesn't use a stack but the concept is the same:
    import java.util.*;
    public class formula {
    public  int aValue = 1;
    public  int bValue = 2;
    public  int cValue = 3;
    public formula() {
       //StringTokenizer st = new StringTokenizer("a + b/c", " abc()+-*/", true);
       //while (st.hasMoreTokens()) { System.out.println(st.nextToken()); }
       StringTokenizer st2 = new StringTokenizer("a + (c - b) + (b * c)", " abc()+-*/", true);
      int operand1 = 0;
      int operand2 = 0;
      int operator = 0;
      //flag: first operand has a value
      boolean firstOperandFull = false;
      //flag: second operand has a value
      boolean secondOperandFull = false;
      //flag: tokens are between parens
      boolean inParens = false;
      Vector inParensVector = null;
      MAINLOOP:
        while (st2.hasMoreTokens()) {
                  String x = st2.nextToken();
                  //if token is a blank skip it.
                  if (x.equals(" ")) { continue MAINLOOP; }
                  System.out.println(x);
                  //if token is open parens set flag and skip to next token
                  if (x.equals("(")) { inParens = true; inParensVector = new Vector(); continue MAINLOOP; }
                  //if tokn is close parens, retrieve the value from between the parens and reset flag.
                  if (x.equals(")")) { if (! firstOperandFull) { operand1 = doInParens(inParensVector); firstOperandFull = true; }
                                       else { operand2 = doInParens(inParensVector); secondOperandFull = true;  }
                                       inParensVector = null; inParens = false; }
                  //if token is open parens store all tokens until close else process the token
                  if (inParens) { inParensVector.add(x); }
                  else {
                       //if token is a variable put correct value in operand
                       if (x.equals("a")) { if (! firstOperandFull) { operand1 = aValue; firstOperandFull = true; }
                                            else { operand2 = aValue; secondOperandFull = true;  } }
                       if (x.equals("b")) { if (! firstOperandFull) { operand1 = bValue; firstOperandFull = true; }
                                            else { operand2 = bValue; secondOperandFull = true;  } }
                       if (x.equals("c")) { if (! firstOperandFull) { operand1 = cValue; firstOperandFull = true; }
                                            else { operand2 = cValue; secondOperandFull = true;  } }
                       //if token is a operator store the operation
                       if (x.equals("+")) { if (firstOperandFull) { operator = 1; } }
                       if (x.equals("-")) { if (firstOperandFull) { operator = 2; } }
                       if (x.equals("*")) { if (firstOperandFull) { operator = 3; } }
                       if (x.equals("/")) { if (firstOperandFull) { operator = 4; } }
                       System.out.println("operand1 = " + operand1 + " operand2 = " + operand2 + " operator = " + operator);
                        //if second operand has a value perform the operation.
                       if (secondOperandFull) {
                                               switch (operator) {
                                                        case 1 : operand1 = add(operand1, operand2); secondOperandFull = false; break;
                                                        case 2 : operand1 = subtract(operand1, operand2); secondOperandFull = false; break;
                                                        case 3 : operand1 = multiply(operand1, operand2); secondOperandFull = false; break;
                                                        case 4 : operand1 = divide(operand1, operand2); secondOperandFull = false; break;
                                                        }//end switch
                                                 } //end if
                     } //End inParens else
      } //End while
    System.out.println("answer = " + operand1);
    public static void main(String[] args) { //formula f = new formula();
    Vector v = new Vector();
    StringTokenizer st = new StringTokenizer(",Greg,,Paul,,", ",", true);
    String token = null;
    String lastToken = " ";
    boolean firstToken = true;
    while (st.hasMoreTokens()) {
    token = st.nextToken();
    if (firstToken) { if (token.equals(",")) { v.add("X"); }
    firstToken = false; }
    if (! token.equals(",")) { v.add(token); }
    else { if (lastToken.equals(",")) { v.add("X"); } }
    lastToken = token;
    } //End While
    if (token.equals(",")) { v.add("X"); }
    Enumeration tokens = v.elements();
    while (tokens.hasMoreElements()) {
          System.out.println((String)tokens.nextElement()); }
    } //End Main
    public int add(int operand1, int operand2) { return operand1 + operand2; }
    public int subtract(int operand1, int operand2) { return operand1 - operand2; }
    public int divide(int operand1, int operand2) { return operand1 / operand2; }
    public int multiply(int operand1, int operand2) { return operand1 * operand2; }
    public int doInParens(Vector inParensVector) {
          int operand1 = 0;
          int operand2 = 0;
          int operator = 0;
          boolean firstOperandFull = false;
          boolean secondOperandFull = false;
          Enumeration tokens = inParensVector.elements();
          INPARENSLOOP:
               while (tokens.hasMoreElements()) {
                  String x = (String)tokens.nextElement();
                  //if token is a blank skip it.
                  if (x.equals(" ")) { continue INPARENSLOOP; }
                  System.out.println("inparens : " + x);
                  //if token is a variable put correct value in operand
                      if (x.equals("a")) { if (! firstOperandFull) { operand1 = aValue; firstOperandFull = true; }
                                          else { operand2 = aValue; secondOperandFull = true;  } }
                  if (x.equals("b")) { if (! firstOperandFull) { operand1 = bValue; firstOperandFull = true; }
                                      else { operand2 = bValue; secondOperandFull = true;  } }
                  if (x.equals("c")) { if (! firstOperandFull) { operand1 = cValue; firstOperandFull = true; }
                                           else { operand2 = cValue; secondOperandFull = true;  } }
                 //if token is a operator store the operation
                 if (x.equals("+")) { if (firstOperandFull) { operator = 1; } }
                  if (x.equals("-")) { if (firstOperandFull) { operator = 2; } }
                 if (x.equals("*")) { if (firstOperandFull) { operator = 3; } }
                 if (x.equals("/")) { if (firstOperandFull) { operator = 4; } }
                  System.out.println("Inparens : operand1 = " + operand1 + " operand2 = " + operand2 + " operator = " + operator);
                 if (secondOperandFull) {
                                         switch (operator) {
                                                   case 1 : operand1 = add(operand1, operand2); secondOperandFull = false; break;
                                                       case 2 : operand1 = subtract(operand1, operand2); secondOperandFull = false; break;
                                                       case 3 : operand1 = multiply(operand1, operand2); secondOperandFull = false; break;
                                                       case 4 : operand1 = divide(operand1, operand2); secondOperandFull = false; break;
                                                       }//end switch
                                         } //end if
                  } //End while
               System.out.println("Inparens return = " + operand1);
               return  operand1;
    }//End doInParens
    }//End Class

  • How to store an image into MySQL db using BlazeDS and Hibernate?

    Hi!
    I am using Flash Builder 4.6, BlazeDS, and Hibernate. How to store a webcam snapshot into the MySql Database. I stored Form Items by using RemoteObject into the database. But I failed to store webcam snapshot. I captured that image on Panel component.I converted that image to ByteArray. Now I want to save that image into the database. Please help me in this regard.
    thanks in advance.
    Here the Code:
    VisitorEntryForm.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow
              xmlns:mx="http://www.adobe.com/2006/mxml"
              xmlns:vo="com.visitor.vo.*"
              width="600"
              height="300"
              defaultButton="{submitButton}"
              showCloseButton="true"
              creationComplete="creationCompleteHandler();"
              close="PopUpManager.removePopUp(this);"
              title="Visitor Entry Form" xmlns:text="flash.text.*">
              <mx:RemoteObject id="saveService" destination="visitorService" result="handleSaveResult(event)" fault="handleFault(event)" showBusyCursor="true" />
              <vo:Visitor id="visitor"
                                               vType="{vTypeField.text}"
                                               vPurpose="{vPurposeField.text}"
                                               vName="{vNameField.text}"
                                               vAddress="{vAddressField.text}"
                                               cPerson="{cPersonField.text}"
                                               cAddress="{cAddressField.text}"
                                     />
                        <mx:Script>
                        <![CDATA[
                        import mx.managers.PopUpManager;
                        import flash.media.Camera;
                        import com.visitor.vo.WebCam;
                        import com.visitor.vo.Base64;
                        import mx.core.UIComponent;
                        import mx.graphics.codec.JPEGEncoder;
                        import mx.controls.Alert;
                        import mx.containers.Canvas;
                        import mx.rpc.events.ResultEvent;
                        import mx.rpc.events.FaultEvent;
                        import mx.events.ValidationResultEvent;
                        import mx.validators.Validator;
                                  [Bindable]
                                  private var webCam: com.visitor.vo.WebCam;
                                  [Bindable]
                                  private var message:String;
                                  [Bindable]
                                  private var formIsValid:Boolean = false;
                                  [Bindable]
                                  public var formIsEmpty:Boolean;
                                  private var focussedFormControl:DisplayObject;
                                  private function handleSaveResult(ev:ResultEvent):void {
                                            clearFormHandler();
                                            validateForm(ev);
                                            Alert.show("Visitor successfully created/updated.", "Information", Alert.OK, null, null, null, Alert.OK);
                                            // Reload the list.
                                            parentApplication.listConsultants.loaderService.getConsultants();
                                            PopUpManager.removePopUp(this);
                                  private function handleFault(ev:FaultEvent):void {
                                            message = "Error: " + ev.fault.faultCode + " \n "
                                                      + "Detail: " + ev.fault.faultDetail + " \n "
                                                      + "Message: " + ev.fault.faultString;
                                  public function saveVisitor():void {
                                            saveService.addUpdateVisitor(visitor);
                                  private function creationCompleteHandler():void {
                                            init();
                                            PopUpManager.centerPopUp(this);
                                            resetFocus();
                                  private function resetFocus():void {
                                            focusManager.setFocus(vTypeField);
                                  public function validateForm(event:Event):void  {
                                            focussedFormControl = event.target as DisplayObject;   
                                            formIsValid = true;
                                            // Check if form is empty
                                            formIsEmpty = (vTypeField.text == "" && vPurposeField.text == "" && vNameField.text == "" && vAddressField.text == "" && cPersonField.text == "" && cAddressField.text == "");
                                            validate(vTypeValidator);               
                                            validate(vPurposeValidator);
                                            validate(vNameValidator);
                                            validate(vAddressValidator);
                                            validate(cPersonValidator);
                                            validate(cAddressValidator);
                                  private function validate(validator:Validator):Boolean {
                                            var validatorSource:DisplayObject = validator.source as DisplayObject;
                                            var suppressEvents:Boolean = (validatorSource != focussedFormControl);
                                            var event:ValidationResultEvent = validator.validate(null, suppressEvents);
                                            var currentControlIsValid:Boolean = (event.type == ValidationResultEvent.VALID);
                                            formIsValid = formIsValid && currentControlIsValid;
                                            return currentControlIsValid;
                                  private function clearFormHandler():void {
                                            // Clear all input fields.
                                            vTypeField.text = "";
                                            vPurposeField.text = "";
                                            vNameField.text = "";
                                            vAddressField.text = "";
                                            cPersonField.text = "";
                                            cAddressField.text = "";
                                            message = "";
                                            // Clear validation error messages.
                                            vTypeField.errorString = "";
                                            vPurposeField.errorString = "";
                                            vNameField.errorString = "";
                                            vAddressField.errorString = "";
                                            cPersonField.errorString = "";
                                            cAddressField.errorString = "";
                                            formIsEmpty = true;
                                            formIsValid = false;
                                            resetFocus();
                                  private function init():void {
                                  webCam = new WebCam(97,97);
                                  var ref:UIComponent = new UIComponent();
                                  preview.removeAllChildren();
                                  preview.addChild(ref);
                                  ref.addChild(webCam);
                                  private function takeSnapshot():void {
                                  imageViewer.visible = true;
                                  imageViewer.width = preview.width;
                                  imageViewer.height = preview.height;
                                  var uiComponent : UIComponent = new UIComponent();
                                  uiComponent.width = webCam.width;
                                  uiComponent.height = webCam.height;
                                  var photoData:Bitmap = webCam.getSnapshot();
                                  var photoBitmap:BitmapData = photoData.bitmapData;
                                  uiComponent.addChild(photoData);
                                  imageViewer.removeAllChildren();
                                  imageViewer.addChild(uiComponent);
                                  private function uploadSnapshot():void
                                            if (imageViewer.getChildren().length > 0)
                                                      var uic:UIComponent = imageViewer.getChildAt(0) as UIComponent;
                                                      var bitmap:Bitmap = uic.getChildAt(0) as Bitmap;
                                                      var jpgEncoder:JPEGEncoder = new JPEGEncoder(75);
                                                      var jpgBytes:ByteArray = jpgEncoder.encode(bitmap.bitmapData);
                                  private function deleteSnapshot():void
                                            imageViewer.removeAllChildren();
                        ]]>
                        </mx:Script>
              <mx:StringValidator id="vTypeValidator"          source="{vTypeField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vPurposeValidator" source="{vPurposeField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vNameValidator"          source="{vNameField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vAddressValidator"          source="{vAddressField}"          property="text" minLength="5" required="true" />
              <mx:StringValidator id="cPersonValidator" source="{cPersonField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="cAddressValidator"          source="{cAddressField}"          property="text" minLength="5" required="true" />
              <mx:Grid width="575" height="211">
                        <mx:GridRow width="575" height="211">
                                  <mx:GridItem width="301" height="235">
                                            <mx:Form width="301" height="208">
                                                      <mx:FormItem label="Visitor's Type">
                                                                <mx:ComboBox id="vTypeField" text="{visitor.vType}" change="validateForm(event);" editable="true">
                                                                          <mx:Array>
                                                                                    <mx:String></mx:String>
                                                                                    <mx:String>Contractor</mx:String>
                                                                                    <mx:String>Supplier</mx:String>
                                                                                    <mx:String>Transporter</mx:String>
                                                                                    <mx:String>Plant</mx:String>
                                                                                    <mx:String>Non-Plant</mx:String>
                                                                          </mx:Array>
                                                                </mx:ComboBox>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Visit Purpose">
                                                                <mx:ComboBox id="vPurposeField" text="{visitor.vPurpose}" change="validateForm(event);" editable="true">
                                                                          <mx:Array>
                                                                                    <mx:String></mx:String>
                                                                                    <mx:String>Official</mx:String>
                                                                                    <mx:String>Personal</mx:String>
                                                                          </mx:Array>
                                                                </mx:ComboBox>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Visitor's Name">
                                                                <mx:TextInput id="vNameField"  text="{visitor.vName}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Address">
                                                                <mx:TextInput id="vAddressField"   text="{visitor.vAddress}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Contact Person">
                                                                <mx:TextInput id="cPersonField"  text="{visitor.cPerson}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Address">
                                                                <mx:TextInput id="cAddressField"  text="{visitor.cAddress}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      </mx:Form>
                                  </mx:GridItem>
                                  <mx:GridItem width="264" height="193">
                                            <mx:Grid width="241" height="206">
                                                      <mx:GridRow width="100%" height="100%">
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                                                                          <mx:Panel width="100" height="132" title="Snap" id="preview" layout="absolute"/>
                                                                </mx:GridItem>
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                                                                          <mx:Panel width="100" height="132" title="Preview" id="imageViewer"  layout="absolute"/>
                                                                </mx:GridItem>
                                                      </mx:GridRow>
                                                      <mx:GridRow width="100%" height="27" >
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center">
                                                                          <mx:Button id="snapshot" x="2" width="106" height="27" label="Snap"
                                                                                                  click="takeSnapshot();"/>
                                                                </mx:GridItem>
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center">
                                                                          <mx:Button id="deleteButton" x="1" width="106" height="27" label="Delete"
                                                                                                  click="deleteSnapshot();"/>
                                                                </mx:GridItem>
                                                      </mx:GridRow>
                                            </mx:Grid>
                                  </mx:GridItem>
                        </mx:GridRow>
              </mx:Grid>
              <mx:ControlBar height="40" horizontalAlign="center">
                        <mx:Button label="Save Visitor"          id="submitButton" enabled="{formIsValid}" click="saveVisitor();" />
                        <mx:Button label="Clear form" enabled="{!formIsEmpty}"          click="clearFormHandler();" />
                        <mx:Button label="Cancel" click="PopUpManager.removePopUp(this);"/>
                        <mx:Label width="211" id="state"/>
              </mx:ControlBar>
              <mx:Text text="{message}" fontWeight="bold" width="300"/>
    </mx:TitleWindow>
    ListVisitors.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Panel
              xmlns:mx="http://www.adobe.com/2006/mxml"
              xmlns:view="com.visitor.view.*"
              width="100%"
              height="100%"
              title="Visitor Management System - Found {visitorRecords} visitors."
              creationComplete="loadVisitors();">
              <mx:RemoteObject id="loaderService" destination="visitorService" result="handleLoadResult(event)"          fault="handleFault(event)" showBusyCursor="true" />
              <mx:RemoteObject id="deleteService" destination="visitorService" result="handleDeleteResult(event)"          fault="handleFault(event)" showBusyCursor="true" />
              <mx:Script>
                        <![CDATA[
                                  import com.visitor.vo.Visitor;
                                  import mx.controls.Alert;
                                  import mx.managers.PopUpManager;
                                  import mx.containers.TitleWindow;
                                  import mx.collections.ArrayCollection;
                                  import mx.rpc.events.ResultEvent;
                                  import mx.rpc.events.FaultEvent;
                                  [Bindable]
                                  private var message:String;
                                  [Bindable]
                                  private var visitors:ArrayCollection = new ArrayCollection();
                                  [Bindable]
                                  private var visitorRecords:int = 0;
                                  public function loadVisitors():void {
                                            loaderService.getVisitors();
                                  private function deleteVisitor():void {
                                            if(dataGrid.selectedItem != null) {
                                                      var selectedItem:Visitor = dataGrid.selectedItem as Visitor;
                                                      deleteService.deleteVisitor(selectedItem.visitorId);
                                  private function createVisitor():void {
                                            var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
                                            titleWindow.setStyle("borderAlpha", 0.9);
                                            titleWindow.formIsEmpty = true;
                                  private function updateVisitor():void {
                                            var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
                                            titleWindow.setStyle("borderAlpha", 0.9);
                                            titleWindow.visitor = dataGrid.selectedItem as Visitor;
                                            titleWindow.formIsEmpty = false;
                                  private function handleLoadResult(ev:ResultEvent):void {
                                            visitors = ev.result as ArrayCollection;
                                            visitorRecords = visitors.length;
                                  private function handleDeleteResult(ev:ResultEvent):void {
                                            Alert.show("The visitor has been deleted.", "Information", Alert.OK, null, null, null, Alert.OK);
                                            loadVisitors();
                                  private function handleFault(ev:FaultEvent):void {
                                            message = "Error: "
                                                      + ev.fault.faultCode + " - "
                                                      + ev.fault.faultDetail + " - "
                                                      + ev.fault.faultString;
                        ]]>
              </mx:Script>
              <mx:VBox width="100%" height="100%">
                        <mx:Label text="{message}" fontWeight="bold" includeInLayout="false" />
                        <mx:DataGrid
                                  id="dataGrid"
                                  width="100%"
                                  height="100%"
                                  dataProvider="{visitors}"
                                  doubleClickEnabled="true"
                                  doubleClick="updateVisitor()" >
                                  <mx:columns>
                                            <mx:DataGridColumn dataField="visitorId"          headerText="Visitor ID" width="100"/>
                                            <mx:DataGridColumn dataField="vType"                    headerText="Visitor's Type" />
                                            <mx:DataGridColumn dataField="vPurpose"           headerText="Visit Purpose" />
                                            <mx:DataGridColumn dataField="vName"                     headerText="Visitor's Name" />
                                            <mx:DataGridColumn dataField="vAddress"                    headerText="Visitor's Address" />
                                            <mx:DataGridColumn dataField="cPerson"                     headerText="Contact Person" />
                                            <mx:DataGridColumn dataField="cAddress"                    headerText="Contact Address" />
                                            <mx:DataGridColumn dataField="timeIn"                     headerText="Time-In" />
                                            <mx:DataGridColumn dataField="timeOut"                     headerText="Time-Out" />
                                            <mx:DataGridColumn dataField="vPhoto"                     headerText="Visitor's Photo" />
                                  </mx:columns>
                        </mx:DataGrid>
                        <mx:ControlBar horizontalAlign="center">
                                  <mx:Button label="Create Visitor"          click="createVisitor()"          toolTip="Create a new visitor and store it in the database." />
                                  <mx:Button label="Update Visitor"          click="updateVisitor()"           enabled="{dataGrid.selectedItem}" toolTip="Update an existing database visitor." />
                                  <mx:Button label="Delete Visitor"          click="deleteVisitor()"          enabled="{dataGrid.selectedItem}" toolTip="Delete the visitor from the database." />
                                  <mx:Button label="Reload Data"                    click="loadVisitors()"           toolTip="Reload the visitor list from the database." />
                        </mx:ControlBar>
              </mx:VBox>
    </mx:Panel>
    Visitor.as
    package com.visitor.vo
              import mx.controls.Image;
              import spark.primitives.BitmapImage;
              [Bindable]
              [RemoteClass(alias="com.visitor.Visitor")]
              public class Visitor
                        public function Visitor()
                        public var visitorId:Number;
                        public var vType:String;
                        public var vPurpose:String;
                        public var vName:String;
                        public var vAddress:String;
                        public var cPerson:String;
                        public var cAddress:String;
                        public var timeIn:Date;
                        public var timeOut:Date;
                       public var vPhoto: Image;
    Visitor.java
    package com.visitor;
    import java.sql.Blob;
    import java.sql.Timestamp;
    import javax.persistence.Basic;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    import org.hibernate.annotations.Index;
    @Entity
    @Table(name = "visitors")
    @NamedQueries( {
                        @NamedQuery(name = "visitors.findAll", query = "from Visitor"),
                        @NamedQuery(name = "visitors.byId", query = "select v from Visitor v where v.visitorId= :visitorId") })
    public class Visitor {
              @Id
              @GeneratedValue(strategy = GenerationType.AUTO)
              @Column(name = "visitorId", nullable = false)
              private Long visitorId;
              @Basic
              @Index(name = "vType_idx_1")
              @Column(name = "vType", nullable = true, unique = false)
              private String vType;
              @Basic
              @Column(name = "vPurpose", nullable = true, unique = false)
              private String vPurpose;
              @Basic
              @Column(name = "vName", nullable = true, unique = false)
              private String vName;
              @Basic
              @Column(name = "vAddress", nullable = true, unique = false)
              private String vAddress;
              @Basic
              @Column(name = "cPerson", nullable = true, unique = false)
              private String cPerson;
              @Basic
              @Column(name = "cAddress", nullable = true, unique = false)
              private String cAddress;
              @Basic
              @Column(name = "timeIn", nullable = false, unique = false)
              private Timestamp timeIn;
              @Basic
              @Column(name = "timeOut", nullable = true, unique = false)
              private Timestamp timeOut;
              @Basic
              @Column(name = "vPhoto", nullable = true, unique = false)
              private Blob vPhoto;
              public Visitor() {
                        super();
              public Long getVisitorId() {
                        return visitorId;
              public void setVisitorId(Long visitorId) {
                        this.visitorId = visitorId;
              public String getvType() {
                        return vType;
              public void setvType(String vType) {
                        this.vType = vType;
              public String getvPurpose() {
                        return vPurpose;
              public void setvPurpose(String vPurpose) {
                        this.vPurpose = vPurpose;
              public String getvName() {
                        return vName;
              public void setvName(String vName) {
                        this.vName = vName;
              public String getvAddress() {
                        return vAddress;
              public void setvAddress(String vAddress) {
                        this.vAddress = vAddress;
              public String getcPerson() {
                        return cPerson;
              public void setcPerson(String cPerson) {
                        this.cPerson = cPerson;
              public String getcAddress() {
                        return cAddress;
              public void setcAddress(String cAddress) {
                        this.cAddress = cAddress;
              public Timestamp getTimeIn() {
                        return timeIn;
              public void setTimeIn(Timestamp timeIn) {
                        this.timeIn = timeIn;
              public Timestamp getTimeOut() {
                        return timeOut;
              public void setTimeOut(Timestamp timeOut) {
                        this.timeOut = timeOut;
              public Blob getvPhoto() {
                        return vPhoto;
              public void setvPhoto(Blob vPhoto) {
                        this.vPhoto = vPhoto;
    VisitorService.java
    package com.visitor;
    import java.sql.Timestamp;
    import java.util.Date;
    import java.util.List;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.EntityTransaction;
    import javax.persistence.Persistence;
    import javax.persistence.Query;
    import org.apache.log4j.Logger;
    public class VisitorService {
              private static final String PERSISTENCE_UNIT = "visitor_db";
              private static Logger logger = Logger.getLogger(VisitorService.class);
              public VisitorService() {
                        super();
              public List<Visitor> getvisitors() {
                        logger.debug("** getVisitors called...");
                        EntityManagerFactory entityManagerFactory = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = entityManagerFactory.createEntityManager();
                        Query findAllQuery = em.createNamedQuery("visitors.findAll");
                        List<Visitor> visitors = findAllQuery.getResultList();
                        if (visitors != null)
                                  logger.debug("** Found " + visitors.size() + " records:");
                        return visitors;
              public void addUpdateVisitor(Visitor visitor) throws Exception {
                        logger.debug("** addUpdateVisitor called...");
                        EntityManagerFactory emf = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = emf.createEntityManager();
                        // When passing Boolean and Number values from the Flash client to a
                        // Java object, Java interprets null values as the default values for
                        // primitive types; for example, 0 for double, float, long, int, short,
                        // byte.
                        if (visitor.getVisitorId() == null          || visitor.getVisitorId() == 0) {
                                  // New consultant is created
                                  visitor.setVisitorId(null);
                                  visitor.setTimeIn(new Timestamp(new Date().getTime()));
                        } else {
                                  visitor.setTimeOut(new Timestamp(new Date().getTime()));
                                  // Existing consultant is updated - do nothing.
                        EntityTransaction tx = em.getTransaction();
                        tx.begin();
                        try {
                                  em.merge(visitor);
                                  tx.commit();
                        } catch (Exception e) {
                                  logger.error("** Error: " + e.getMessage());
                                  tx.rollback();
                                  throw new Exception(e.getMessage());
                        } finally {
                                  logger.info("** Closing Entity Manager.");
                                  em.close();
              public void deleteVisitor(Long visitorId) {
                        logger.debug("** deleteVisitor called...");
                        EntityManagerFactory emf = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = emf.createEntityManager();
                        Query q = em.createNamedQuery("visitors.byId");
                        q.setParameter("visitorId", visitorId);
                        Visitor visitor = (Visitor) q.getSingleResult();
                        if (visitor != null) {
                                  EntityTransaction tx = em.getTransaction();
                                  tx.begin();
                                  try {
                                            em.remove(visitor);
                                            tx.commit();
                                  } catch (Exception e) {
                                            logger.error("** Error: " + e.getMessage());
                                            tx.rollback();
                                  } finally {
                                            logger.info("** Closing Entity Manager.");
                                            em.close();
    remoting-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="remoting-service" class="flex.messaging.services.RemotingService">
              <adapters>
                        <adapter-definition id="java-object"
                                  class="flex.messaging.services.remoting.adapters.JavaAdapter"
                                  default="true" />
              </adapters>
              <default-channels>
                        <channel ref="my-amf" />
              </default-channels>
              <!-- ADC Demo application -->
              <destination id="visitorService">
                        <properties>
                                  <source>com.visitor.VisitorService</source>
                        </properties>
              </destination>
    </service>

    Hi!
    I am using Flash Builder 4.6, BlazeDS, and Hibernate. How to store a webcam snapshot into the MySql Database. I stored Form Items by using RemoteObject into the database. But I failed to store webcam snapshot. I captured that image on Panel component.I converted that image to ByteArray. Now I want to save that image into the database. Please help me in this regard.
    thanks in advance.
    Here the Code:
    VisitorEntryForm.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow
              xmlns:mx="http://www.adobe.com/2006/mxml"
              xmlns:vo="com.visitor.vo.*"
              width="600"
              height="300"
              defaultButton="{submitButton}"
              showCloseButton="true"
              creationComplete="creationCompleteHandler();"
              close="PopUpManager.removePopUp(this);"
              title="Visitor Entry Form" xmlns:text="flash.text.*">
              <mx:RemoteObject id="saveService" destination="visitorService" result="handleSaveResult(event)" fault="handleFault(event)" showBusyCursor="true" />
              <vo:Visitor id="visitor"
                                               vType="{vTypeField.text}"
                                               vPurpose="{vPurposeField.text}"
                                               vName="{vNameField.text}"
                                               vAddress="{vAddressField.text}"
                                               cPerson="{cPersonField.text}"
                                               cAddress="{cAddressField.text}"
                                     />
                        <mx:Script>
                        <![CDATA[
                        import mx.managers.PopUpManager;
                        import flash.media.Camera;
                        import com.visitor.vo.WebCam;
                        import com.visitor.vo.Base64;
                        import mx.core.UIComponent;
                        import mx.graphics.codec.JPEGEncoder;
                        import mx.controls.Alert;
                        import mx.containers.Canvas;
                        import mx.rpc.events.ResultEvent;
                        import mx.rpc.events.FaultEvent;
                        import mx.events.ValidationResultEvent;
                        import mx.validators.Validator;
                                  [Bindable]
                                  private var webCam: com.visitor.vo.WebCam;
                                  [Bindable]
                                  private var message:String;
                                  [Bindable]
                                  private var formIsValid:Boolean = false;
                                  [Bindable]
                                  public var formIsEmpty:Boolean;
                                  private var focussedFormControl:DisplayObject;
                                  private function handleSaveResult(ev:ResultEvent):void {
                                            clearFormHandler();
                                            validateForm(ev);
                                            Alert.show("Visitor successfully created/updated.", "Information", Alert.OK, null, null, null, Alert.OK);
                                            // Reload the list.
                                            parentApplication.listConsultants.loaderService.getConsultants();
                                            PopUpManager.removePopUp(this);
                                  private function handleFault(ev:FaultEvent):void {
                                            message = "Error: " + ev.fault.faultCode + " \n "
                                                      + "Detail: " + ev.fault.faultDetail + " \n "
                                                      + "Message: " + ev.fault.faultString;
                                  public function saveVisitor():void {
                                            saveService.addUpdateVisitor(visitor);
                                  private function creationCompleteHandler():void {
                                            init();
                                            PopUpManager.centerPopUp(this);
                                            resetFocus();
                                  private function resetFocus():void {
                                            focusManager.setFocus(vTypeField);
                                  public function validateForm(event:Event):void  {
                                            focussedFormControl = event.target as DisplayObject;   
                                            formIsValid = true;
                                            // Check if form is empty
                                            formIsEmpty = (vTypeField.text == "" && vPurposeField.text == "" && vNameField.text == "" && vAddressField.text == "" && cPersonField.text == "" && cAddressField.text == "");
                                            validate(vTypeValidator);               
                                            validate(vPurposeValidator);
                                            validate(vNameValidator);
                                            validate(vAddressValidator);
                                            validate(cPersonValidator);
                                            validate(cAddressValidator);
                                  private function validate(validator:Validator):Boolean {
                                            var validatorSource:DisplayObject = validator.source as DisplayObject;
                                            var suppressEvents:Boolean = (validatorSource != focussedFormControl);
                                            var event:ValidationResultEvent = validator.validate(null, suppressEvents);
                                            var currentControlIsValid:Boolean = (event.type == ValidationResultEvent.VALID);
                                            formIsValid = formIsValid && currentControlIsValid;
                                            return currentControlIsValid;
                                  private function clearFormHandler():void {
                                            // Clear all input fields.
                                            vTypeField.text = "";
                                            vPurposeField.text = "";
                                            vNameField.text = "";
                                            vAddressField.text = "";
                                            cPersonField.text = "";
                                            cAddressField.text = "";
                                            message = "";
                                            // Clear validation error messages.
                                            vTypeField.errorString = "";
                                            vPurposeField.errorString = "";
                                            vNameField.errorString = "";
                                            vAddressField.errorString = "";
                                            cPersonField.errorString = "";
                                            cAddressField.errorString = "";
                                            formIsEmpty = true;
                                            formIsValid = false;
                                            resetFocus();
                                  private function init():void {
                                  webCam = new WebCam(97,97);
                                  var ref:UIComponent = new UIComponent();
                                  preview.removeAllChildren();
                                  preview.addChild(ref);
                                  ref.addChild(webCam);
                                  private function takeSnapshot():void {
                                  imageViewer.visible = true;
                                  imageViewer.width = preview.width;
                                  imageViewer.height = preview.height;
                                  var uiComponent : UIComponent = new UIComponent();
                                  uiComponent.width = webCam.width;
                                  uiComponent.height = webCam.height;
                                  var photoData:Bitmap = webCam.getSnapshot();
                                  var photoBitmap:BitmapData = photoData.bitmapData;
                                  uiComponent.addChild(photoData);
                                  imageViewer.removeAllChildren();
                                  imageViewer.addChild(uiComponent);
                                  private function uploadSnapshot():void
                                            if (imageViewer.getChildren().length > 0)
                                                      var uic:UIComponent = imageViewer.getChildAt(0) as UIComponent;
                                                      var bitmap:Bitmap = uic.getChildAt(0) as Bitmap;
                                                      var jpgEncoder:JPEGEncoder = new JPEGEncoder(75);
                                                      var jpgBytes:ByteArray = jpgEncoder.encode(bitmap.bitmapData);
                                  private function deleteSnapshot():void
                                            imageViewer.removeAllChildren();
                        ]]>
                        </mx:Script>
              <mx:StringValidator id="vTypeValidator"          source="{vTypeField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vPurposeValidator" source="{vPurposeField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vNameValidator"          source="{vNameField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="vAddressValidator"          source="{vAddressField}"          property="text" minLength="5" required="true" />
              <mx:StringValidator id="cPersonValidator" source="{cPersonField}"          property="text" minLength="2" required="true" />
              <mx:StringValidator id="cAddressValidator"          source="{cAddressField}"          property="text" minLength="5" required="true" />
              <mx:Grid width="575" height="211">
                        <mx:GridRow width="575" height="211">
                                  <mx:GridItem width="301" height="235">
                                            <mx:Form width="301" height="208">
                                                      <mx:FormItem label="Visitor's Type">
                                                                <mx:ComboBox id="vTypeField" text="{visitor.vType}" change="validateForm(event);" editable="true">
                                                                          <mx:Array>
                                                                                    <mx:String></mx:String>
                                                                                    <mx:String>Contractor</mx:String>
                                                                                    <mx:String>Supplier</mx:String>
                                                                                    <mx:String>Transporter</mx:String>
                                                                                    <mx:String>Plant</mx:String>
                                                                                    <mx:String>Non-Plant</mx:String>
                                                                          </mx:Array>
                                                                </mx:ComboBox>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Visit Purpose">
                                                                <mx:ComboBox id="vPurposeField" text="{visitor.vPurpose}" change="validateForm(event);" editable="true">
                                                                          <mx:Array>
                                                                                    <mx:String></mx:String>
                                                                                    <mx:String>Official</mx:String>
                                                                                    <mx:String>Personal</mx:String>
                                                                          </mx:Array>
                                                                </mx:ComboBox>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Visitor's Name">
                                                                <mx:TextInput id="vNameField"  text="{visitor.vName}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Address">
                                                                <mx:TextInput id="vAddressField"   text="{visitor.vAddress}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Contact Person">
                                                                <mx:TextInput id="cPersonField"  text="{visitor.cPerson}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      <mx:FormItem label="Address">
                                                                <mx:TextInput id="cAddressField"  text="{visitor.cAddress}" change="validateForm(event);"/>
                                                      </mx:FormItem>
                                                      </mx:Form>
                                  </mx:GridItem>
                                  <mx:GridItem width="264" height="193">
                                            <mx:Grid width="241" height="206">
                                                      <mx:GridRow width="100%" height="100%">
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                                                                          <mx:Panel width="100" height="132" title="Snap" id="preview" layout="absolute"/>
                                                                </mx:GridItem>
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                                                                          <mx:Panel width="100" height="132" title="Preview" id="imageViewer"  layout="absolute"/>
                                                                </mx:GridItem>
                                                      </mx:GridRow>
                                                      <mx:GridRow width="100%" height="27" >
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center">
                                                                          <mx:Button id="snapshot" x="2" width="106" height="27" label="Snap"
                                                                                                  click="takeSnapshot();"/>
                                                                </mx:GridItem>
                                                                <mx:GridItem width="100%" height="100%" horizontalAlign="center">
                                                                          <mx:Button id="deleteButton" x="1" width="106" height="27" label="Delete"
                                                                                                  click="deleteSnapshot();"/>
                                                                </mx:GridItem>
                                                      </mx:GridRow>
                                            </mx:Grid>
                                  </mx:GridItem>
                        </mx:GridRow>
              </mx:Grid>
              <mx:ControlBar height="40" horizontalAlign="center">
                        <mx:Button label="Save Visitor"          id="submitButton" enabled="{formIsValid}" click="saveVisitor();" />
                        <mx:Button label="Clear form" enabled="{!formIsEmpty}"          click="clearFormHandler();" />
                        <mx:Button label="Cancel" click="PopUpManager.removePopUp(this);"/>
                        <mx:Label width="211" id="state"/>
              </mx:ControlBar>
              <mx:Text text="{message}" fontWeight="bold" width="300"/>
    </mx:TitleWindow>
    ListVisitors.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Panel
              xmlns:mx="http://www.adobe.com/2006/mxml"
              xmlns:view="com.visitor.view.*"
              width="100%"
              height="100%"
              title="Visitor Management System - Found {visitorRecords} visitors."
              creationComplete="loadVisitors();">
              <mx:RemoteObject id="loaderService" destination="visitorService" result="handleLoadResult(event)"          fault="handleFault(event)" showBusyCursor="true" />
              <mx:RemoteObject id="deleteService" destination="visitorService" result="handleDeleteResult(event)"          fault="handleFault(event)" showBusyCursor="true" />
              <mx:Script>
                        <![CDATA[
                                  import com.visitor.vo.Visitor;
                                  import mx.controls.Alert;
                                  import mx.managers.PopUpManager;
                                  import mx.containers.TitleWindow;
                                  import mx.collections.ArrayCollection;
                                  import mx.rpc.events.ResultEvent;
                                  import mx.rpc.events.FaultEvent;
                                  [Bindable]
                                  private var message:String;
                                  [Bindable]
                                  private var visitors:ArrayCollection = new ArrayCollection();
                                  [Bindable]
                                  private var visitorRecords:int = 0;
                                  public function loadVisitors():void {
                                            loaderService.getVisitors();
                                  private function deleteVisitor():void {
                                            if(dataGrid.selectedItem != null) {
                                                      var selectedItem:Visitor = dataGrid.selectedItem as Visitor;
                                                      deleteService.deleteVisitor(selectedItem.visitorId);
                                  private function createVisitor():void {
                                            var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
                                            titleWindow.setStyle("borderAlpha", 0.9);
                                            titleWindow.formIsEmpty = true;
                                  private function updateVisitor():void {
                                            var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
                                            titleWindow.setStyle("borderAlpha", 0.9);
                                            titleWindow.visitor = dataGrid.selectedItem as Visitor;
                                            titleWindow.formIsEmpty = false;
                                  private function handleLoadResult(ev:ResultEvent):void {
                                            visitors = ev.result as ArrayCollection;
                                            visitorRecords = visitors.length;
                                  private function handleDeleteResult(ev:ResultEvent):void {
                                            Alert.show("The visitor has been deleted.", "Information", Alert.OK, null, null, null, Alert.OK);
                                            loadVisitors();
                                  private function handleFault(ev:FaultEvent):void {
                                            message = "Error: "
                                                      + ev.fault.faultCode + " - "
                                                      + ev.fault.faultDetail + " - "
                                                      + ev.fault.faultString;
                        ]]>
              </mx:Script>
              <mx:VBox width="100%" height="100%">
                        <mx:Label text="{message}" fontWeight="bold" includeInLayout="false" />
                        <mx:DataGrid
                                  id="dataGrid"
                                  width="100%"
                                  height="100%"
                                  dataProvider="{visitors}"
                                  doubleClickEnabled="true"
                                  doubleClick="updateVisitor()" >
                                  <mx:columns>
                                            <mx:DataGridColumn dataField="visitorId"          headerText="Visitor ID" width="100"/>
                                            <mx:DataGridColumn dataField="vType"                    headerText="Visitor's Type" />
                                            <mx:DataGridColumn dataField="vPurpose"           headerText="Visit Purpose" />
                                            <mx:DataGridColumn dataField="vName"                     headerText="Visitor's Name" />
                                            <mx:DataGridColumn dataField="vAddress"                    headerText="Visitor's Address" />
                                            <mx:DataGridColumn dataField="cPerson"                     headerText="Contact Person" />
                                            <mx:DataGridColumn dataField="cAddress"                    headerText="Contact Address" />
                                            <mx:DataGridColumn dataField="timeIn"                     headerText="Time-In" />
                                            <mx:DataGridColumn dataField="timeOut"                     headerText="Time-Out" />
                                            <mx:DataGridColumn dataField="vPhoto"                     headerText="Visitor's Photo" />
                                  </mx:columns>
                        </mx:DataGrid>
                        <mx:ControlBar horizontalAlign="center">
                                  <mx:Button label="Create Visitor"          click="createVisitor()"          toolTip="Create a new visitor and store it in the database." />
                                  <mx:Button label="Update Visitor"          click="updateVisitor()"           enabled="{dataGrid.selectedItem}" toolTip="Update an existing database visitor." />
                                  <mx:Button label="Delete Visitor"          click="deleteVisitor()"          enabled="{dataGrid.selectedItem}" toolTip="Delete the visitor from the database." />
                                  <mx:Button label="Reload Data"                    click="loadVisitors()"           toolTip="Reload the visitor list from the database." />
                        </mx:ControlBar>
              </mx:VBox>
    </mx:Panel>
    Visitor.as
    package com.visitor.vo
              import mx.controls.Image;
              import spark.primitives.BitmapImage;
              [Bindable]
              [RemoteClass(alias="com.visitor.Visitor")]
              public class Visitor
                        public function Visitor()
                        public var visitorId:Number;
                        public var vType:String;
                        public var vPurpose:String;
                        public var vName:String;
                        public var vAddress:String;
                        public var cPerson:String;
                        public var cAddress:String;
                        public var timeIn:Date;
                        public var timeOut:Date;
                       public var vPhoto: Image;
    Visitor.java
    package com.visitor;
    import java.sql.Blob;
    import java.sql.Timestamp;
    import javax.persistence.Basic;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    import org.hibernate.annotations.Index;
    @Entity
    @Table(name = "visitors")
    @NamedQueries( {
                        @NamedQuery(name = "visitors.findAll", query = "from Visitor"),
                        @NamedQuery(name = "visitors.byId", query = "select v from Visitor v where v.visitorId= :visitorId") })
    public class Visitor {
              @Id
              @GeneratedValue(strategy = GenerationType.AUTO)
              @Column(name = "visitorId", nullable = false)
              private Long visitorId;
              @Basic
              @Index(name = "vType_idx_1")
              @Column(name = "vType", nullable = true, unique = false)
              private String vType;
              @Basic
              @Column(name = "vPurpose", nullable = true, unique = false)
              private String vPurpose;
              @Basic
              @Column(name = "vName", nullable = true, unique = false)
              private String vName;
              @Basic
              @Column(name = "vAddress", nullable = true, unique = false)
              private String vAddress;
              @Basic
              @Column(name = "cPerson", nullable = true, unique = false)
              private String cPerson;
              @Basic
              @Column(name = "cAddress", nullable = true, unique = false)
              private String cAddress;
              @Basic
              @Column(name = "timeIn", nullable = false, unique = false)
              private Timestamp timeIn;
              @Basic
              @Column(name = "timeOut", nullable = true, unique = false)
              private Timestamp timeOut;
              @Basic
              @Column(name = "vPhoto", nullable = true, unique = false)
              private Blob vPhoto;
              public Visitor() {
                        super();
              public Long getVisitorId() {
                        return visitorId;
              public void setVisitorId(Long visitorId) {
                        this.visitorId = visitorId;
              public String getvType() {
                        return vType;
              public void setvType(String vType) {
                        this.vType = vType;
              public String getvPurpose() {
                        return vPurpose;
              public void setvPurpose(String vPurpose) {
                        this.vPurpose = vPurpose;
              public String getvName() {
                        return vName;
              public void setvName(String vName) {
                        this.vName = vName;
              public String getvAddress() {
                        return vAddress;
              public void setvAddress(String vAddress) {
                        this.vAddress = vAddress;
              public String getcPerson() {
                        return cPerson;
              public void setcPerson(String cPerson) {
                        this.cPerson = cPerson;
              public String getcAddress() {
                        return cAddress;
              public void setcAddress(String cAddress) {
                        this.cAddress = cAddress;
              public Timestamp getTimeIn() {
                        return timeIn;
              public void setTimeIn(Timestamp timeIn) {
                        this.timeIn = timeIn;
              public Timestamp getTimeOut() {
                        return timeOut;
              public void setTimeOut(Timestamp timeOut) {
                        this.timeOut = timeOut;
              public Blob getvPhoto() {
                        return vPhoto;
              public void setvPhoto(Blob vPhoto) {
                        this.vPhoto = vPhoto;
    VisitorService.java
    package com.visitor;
    import java.sql.Timestamp;
    import java.util.Date;
    import java.util.List;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.EntityTransaction;
    import javax.persistence.Persistence;
    import javax.persistence.Query;
    import org.apache.log4j.Logger;
    public class VisitorService {
              private static final String PERSISTENCE_UNIT = "visitor_db";
              private static Logger logger = Logger.getLogger(VisitorService.class);
              public VisitorService() {
                        super();
              public List<Visitor> getvisitors() {
                        logger.debug("** getVisitors called...");
                        EntityManagerFactory entityManagerFactory = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = entityManagerFactory.createEntityManager();
                        Query findAllQuery = em.createNamedQuery("visitors.findAll");
                        List<Visitor> visitors = findAllQuery.getResultList();
                        if (visitors != null)
                                  logger.debug("** Found " + visitors.size() + " records:");
                        return visitors;
              public void addUpdateVisitor(Visitor visitor) throws Exception {
                        logger.debug("** addUpdateVisitor called...");
                        EntityManagerFactory emf = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = emf.createEntityManager();
                        // When passing Boolean and Number values from the Flash client to a
                        // Java object, Java interprets null values as the default values for
                        // primitive types; for example, 0 for double, float, long, int, short,
                        // byte.
                        if (visitor.getVisitorId() == null          || visitor.getVisitorId() == 0) {
                                  // New consultant is created
                                  visitor.setVisitorId(null);
                                  visitor.setTimeIn(new Timestamp(new Date().getTime()));
                        } else {
                                  visitor.setTimeOut(new Timestamp(new Date().getTime()));
                                  // Existing consultant is updated - do nothing.
                        EntityTransaction tx = em.getTransaction();
                        tx.begin();
                        try {
                                  em.merge(visitor);
                                  tx.commit();
                        } catch (Exception e) {
                                  logger.error("** Error: " + e.getMessage());
                                  tx.rollback();
                                  throw new Exception(e.getMessage());
                        } finally {
                                  logger.info("** Closing Entity Manager.");
                                  em.close();
              public void deleteVisitor(Long visitorId) {
                        logger.debug("** deleteVisitor called...");
                        EntityManagerFactory emf = Persistence
                                            .createEntityManagerFactory(PERSISTENCE_UNIT);
                        EntityManager em = emf.createEntityManager();
                        Query q = em.createNamedQuery("visitors.byId");
                        q.setParameter("visitorId", visitorId);
                        Visitor visitor = (Visitor) q.getSingleResult();
                        if (visitor != null) {
                                  EntityTransaction tx = em.getTransaction();
                                  tx.begin();
                                  try {
                                            em.remove(visitor);
                                            tx.commit();
                                  } catch (Exception e) {
                                            logger.error("** Error: " + e.getMessage());
                                            tx.rollback();
                                  } finally {
                                            logger.info("** Closing Entity Manager.");
                                            em.close();
    remoting-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="remoting-service" class="flex.messaging.services.RemotingService">
              <adapters>
                        <adapter-definition id="java-object"
                                  class="flex.messaging.services.remoting.adapters.JavaAdapter"
                                  default="true" />
              </adapters>
              <default-channels>
                        <channel ref="my-amf" />
              </default-channels>
              <!-- ADC Demo application -->
              <destination id="visitorService">
                        <properties>
                                  <source>com.visitor.VisitorService</source>
                        </properties>
              </destination>
    </service>

  • How to make BI Info obj Data element in-herit source DE documntn?

    Say I am in ECC. I go to SE11, give table name MARA and then doubleclick on the dataelement 'MATNR'. Then I click on documentation. I get a popup with Short text " Material Number" and Definition "Alphanumeric key uniquely identifying the material'.
    I am interested in the latter information that is 'Definition' - & in general whatever documentation comes up for data element in ECC.CRM.SCM,SRM.
    Now I log into SAP BI. I find that under characteristic 0Material, the data element is /BI0/oimaterial. When I double-click this datamaterial and press the documentation button, the system says 'No documentation'.
    My Questions:
    1. IS there a switch we could turn on in source ECC/SRM/CRM/SRM so that the data element in SAP BI inherits the original source field data element documentation.
    { I am not too convinced of the argument- that in BI we have info objects in ECC we have fields - since I am talking of data element level information- I would tend to think of this as an oversight of the designers or de-prioritization !!}.
    2. Could we have an ABAP workaround? That is, in BI we identify the tables that house the mapping between the source and destination data elementsa and take out this information. Then we extract the dataelement documentation by function DOCU_GET (from eCC) and use the mapping info above to link SAP BI data element with source data element documentation.
    WHY do I want to punish myself as above? My use case is, we take out SAP BI Table, field, metadata etc and create a model in a modeling tool and physical implementation in a 3rd party DW database as our own canonical, application-agnostic corporate datawarehouse. I would want the source data element documentation to flow to this last system as well as the modeling tool.
    Regards
    Sasanka

    That is, in BI we identify the tables that house the mapping between the source and destination data elementsa and take out this information. Then we extract the dataelement documentation by function DOCU_GET (from eCC) and use the mapping info above to link SAP BI data element with source data element documentation.
    1) SAP don't supply this, I would imagine, because R/3 isn't the only possible source of data.  I'm currently working on an app that extracts from R/3, an Oracle database and APO.  From whence should I take the documentation for my MATERIAL info object?  While being able to transfer the documentation of data elements might be very useful for your app, I can't see that generally it would be of interest to clients - I've certainly never heard of such a requirement.  So, my opinion at least, it isn't a design flaw.
    2) As you've pointed out, you can get the tables that do the mapping, so you know the source data elements, so you can get the documentation.  I'm not sure of how to store the documentation, but the obvious candidate for a link between infoobject and dataelement would be master data of an own infoobject.  You could wrap DOCU_GET in an RFC (if it isn't RFC enabled), and do a direct call between your 3rd party app and r/3 to get the documentation.  For information about the mapping tables, I'd suggest asking that question specifically in one of the BI forums.
    matt

  • What's the best way to store my info externally

    I have recently bought my first Macbook Pro 13" with 2.4 Ghz. I am currently using it for my own business and do tend to get a lot of files together. I went to look at "About this Mac" and have already got 369 Gb used up in storage... I have no idea how I have done that as I have hardly downloaded any apps on this computer besides the ones that were on here. I did download Vware Fusion 4 as I have a reservation system which I used to run on my pc and need to have this on here too so perhaps that software takes a lot of space.
    Could anyone advise on which is the best way to store my info externally, will any external harddrive do, or do you need a special one for Apple or Macbook pro. I am just asking as I have no idea and prefer to buy the right one straight away.
    Any help would be much appreciated !
    Thanks, Sara***

    Sara,
    The most reliable method is to use an external hard drive.  Some are better than others, but most will work.
    For the least amount of setup pain, I prefer to deal with the Mac specialists at OWC, http://www.macsales.com as they stand behind their products with great warranty and support.  I have one of their Mercury Elite Pro 2 TB drives that has multiple interface capability so you can get a fast interface for data transfer.
    Take a look at what they offer and see what fits your needs.  If you have more questions about doing thin, just ask on here.
    Ralph

  • How To Store pdf or doc file in Oracle Database using Java Jdbc?

    can any one help me out How To Store pdf or doc file in Oracle Database using Java Jdbc in JSP/Serlet? i tried like anything. using blob also i tried. but i am able 2 store images in DB not files. please if u know or else if u have some code like this plz send that to me, and help me out plz. i need that urgent.

    Hi.. i am not getting error, But i am not getting the original contents from my file. i am getting all ASCII vales, instead of my original data. here i am including my code.
    for Adding PDF in DB i used image.jsp
    Database table structure (table name. pictures )
    Name Null? Type
    ID NOT NULL NUMBER(11)
    IMAGE BLOB
    <%@ page language="java" import="java.util.*,java.sql.*,java.io.*" pageEncoding="ISO-8859-1"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%
    try{
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
         PreparedStatement ps,pstmt,psmnt;
         ps = con.prepareStatement("INSERT INTO pictures VALUES(?,?)");
    File file =
    new File("D:/info.pdf");
    FileInputStream fs = new FileInputStream(file);
    ps.setInt(1,4);
    ps.setBinaryStream(2,fs,fs.available());
    int i = ps.executeUpdate();
    if(i!=0){
    out.println("<h2>PDF inserted successfully");
    else{
    out.println("<h2>Problem in image insertion");
    catch(Exception e){
    out.println("<h2>Failed Due To "+e);
    %>
    O/P: PDF inserted successfully
    i tried to display that pdf using servlet. i am giving the code below.
    import java.io.IOException;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class DispPDF extends HttpServlet {
         * The doGet method of the servlet. <br>
         * This method is called when a form has its tag value method equals to get.
         * @param request the request send by the client to the server
         * @param response the response send by the server to the client
         * @throws ServletException if an error occurred
         * @throws IOException if an error occurred
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              //response.setContentType("text/html"); i commented. coz we cant use response two times.
              //PrintWriter out = response.getWriter();
              try{
                   InputStream sPdf;
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                        Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
                        PreparedStatement ps,pstmt,psmnt;
                   psmnt = con.prepareStatement("SELECT image FROM pictures WHERE id = ?");
                        psmnt.setString(1, "4"); // here integer number '4' is image id from the table.
                   ResultSet rs = psmnt.executeQuery();
                        if(rs.next()) {
                   byte[] bytearray = new byte[1048576];
                        //out.println(bytearray);
                        int size=0;
                        sPdf = rs.getBinaryStream(1);
                        response.reset();
                        response.setContentType("application/pdf");
                        while((size=sPdf.read(bytearray))!= -1 ){
                        //out.println(size);
                        response.getOutputStream().write(bytearray,0,size);
                   catch(Exception e){
                   System.out.println("Failed Due To "+e);
                        //out.println("<h2>Failed Due To "+e);
              //out.close();
    OP
    PDF-1.4 %âãÏÓ 2 0 obj <>stream xœ+är á26S°00SIá2PÐ5´1ôÝ BÒ¸4Ü2‹ŠKüsSŠSŠS4C²€ê P”kø$V㙂GÒU×713CkW )(Ü endstream endobj 4 0 obj <>>>/MediaBox[0 0 595 842]>> endobj 1 0 obj <> endobj 3 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj xref 0 7 0000000000 65535 f 0000000325 00000 n 0000000015 00000 n 0000000413 00000 n 0000000168 00000 n 0000000464 00000 n 0000000509 00000 n trailer <<01b2fa8b70ac262bfa939cc786f8770c>]/Root 5 0 R/Size 7/Info 6 0 R>> startxref 641 %%EOF
    plz help me out.

  • How to store "hidden information" in Interactive Forms?

    Hi all,
    I need to store additional information for single fields of a form. This information should not be visible for the user. I retrieve this additonal information by calling a web service in Javascript for each field.
    Of course I could simply use additonal fields and mark them as "invisible". Since I need this for each field of my form, I would end up with many many invisible fields. This does not sound like a good idea.
    My crude idea is to simply modify the XML Source of the form and include the information there in plain XML. Of course I can do so by simply editing the XML Sourvce in Livecycle Designer. But how can I read out and write into these manually created data structures during run-time? Is there any way to access that? Is the XML source accessible at all during run-time?
    Thanks in advance
    Christoph

    Hi Christoph,
    You can use the WebService and populate the additional information into different fields.
    Here you can cheive this by having many single fields and populating information into those fields or by using a single hidden fields and write the JavaScript to populate the information having a delimiter set to defferentiate the different information.
    To do this first you call a WebService by having a submit button or you need to cal Webservice from Form Ready event of the field or from the change event of the field(this event works fine for drop down).
    From where you are generating the WebService(for eg if its an Function Module), there you need to have an,( eg. variable A), variable as a export parameter. And this parameter must be of type String and in coding you need to concatenate your all information into variable A using a delimiter (like ^, rarely used characters) set by you. And in the form you bind the variable A (in response of the Data Connection ) to hidden variable. Now below the Code where you have called the WebService there write the JavaScript to split the information stored in the Hidden variable.
    Regards
    Pradeep Goli

  • How to store date in database , taking cre of timezone

    Hello java users
    I have a user interface in which a user can pick a date, time and timezone.
    Implemented simply.
    start Date as a textbox: format - MM/dd/yyyy
    start time as a textbox : format - HH/mm/ss
    start timezone as a drop down. And currently there is only 3 values here: PST,EST,CST. As this is what we support.
    I am using MSSQL and my date field column ( startdate ) is of type datetime.
    Now how will I pass the correct value to the database.
    Some more details.
    I have a bean i which I am able to retrieve all the values.
    public class MyBean implements serializable{
    private Date startDate;
    private Date startTime;
    private String timezone; // this will store the timezone id selected by the user.
    //getters and setters
    Now, how will I combine all the values selected by the user and set in the bean and save it in the database.
    I am sure there are a lot of times someone has tried to do this. But I am having a hard time finding this info in a collective manner.
    Any help would be usefull
    Thanks
    Aayush

    Its does help.
    And yes it is requirement to get the date and time and the timezone info from the user through a UI.
    And date is in format : MM/dd/yyyy
    time is in format : HH:mm:ss
    and there are 3 timezones : PST,EST,CST (And yes these are valid timezone ids).
    I guess, the other way to put this is that - The user input is the way to get the StartTime data.
    And ya it makes sense to have separate fields in the database to store date and timezone.
    I am fairly new on this date part and its confusing me a little.
    So I will go into a little more details.
    As u suggested that it would be a good idea to have 3 separate fields for doing this.
    you mean to have 3 fields in the database with columns like
    1. startDate - datetime // to store the start date ( MM/dd/yyyy)
    2. startTime - datetime // to store the start time ( HH:mm:ss). Is it possible to store only time in the database or are you suggesting to combine date and time in one database field.
    3. startTimeZone - varchar // to store time zone.
    So how do I achieve this.
    lets say I get these values;
    String startDate = "09/06/2008";
    String startTime = "11:10:12";
    String startTimeZone = EST;
    now how will I store it in the database.
    consider I have a java bean
    public class StartTimeBean{
    private Date startDate ;
    private Date startTime ;
    private String startTimeZone;
    also I am using a OR mapping tool ( ibatis )
    And I have my insert statement mapped to the bean StartTime.
    Essentially what I am looking for a say method say , createTime(StartTimeBean startTimeBean )
    so how will I store the info in the database

Maybe you are looking for