How do i convert an object into a string?

has said above, im trying to convert a object to a string.
here is what i ahve so far:
Object nodeInfo = node.getUserObject()

RTFM
Object o =...
String str = o.toString();

Similar Messages

  • How can I convert table object into table record format?

    I need to write a store procedure to convert table object into table record. The stored procedure will have a table object IN and then pass the data into another stored procedure with a table record IN. Data passed in may contain more than one record in the table object. Is there any example I can take a look? Thanks.

    I'm afraid it's a bit labourious but here's an example.
    I think it's a good idea to work with SQL objects rather than PL/SQL nested tables.
    SQL> CREATE OR REPLACE TYPE emp_t AS OBJECT
      2      (eno NUMBER(4)
      3      , ename  VARCHAR2(10)
      4      , job VARCHAR2(9)
      5      , mgr  NUMBER(4)
      6      , hiredate  DATE
      7      , sal  NUMBER(7,2)
      8      , comm  NUMBER(7,2)
      9      , deptno  NUMBER(2));
    10  /
    Type created.
    SQL> CREATE OR REPLACE TYPE staff_nt AS TABLE OF emp_t
      2  /
    Type created.
    SQL> Now we've got some Types let's use them. I've only implemented this as one public procedure but you can see the principles in action.
    SQL> CREATE OR REPLACE PACKAGE emp_utils AS
      2      TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
      3      PROCEDURE pop_emp (p_emps in staff_nt);
      4  END  emp_utils;
      5  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY emp_utils AS
      2      FUNCTION emp_obj_to_rows (p_emps IN staff_nt) RETURN EmpCurTyp IS
      3          rc EmpCurTyp;
      4      BEGIN
      5          OPEN rc FOR SELECT * FROM TABLE( CAST ( p_emps AS staff_nt ));
      6          RETURN rc;
      7      END  emp_obj_to_rows;
      8      PROCEDURE pop_emp (p_emps in staff_nt) is
      9          e_rec emp%ROWTYPE;
    10          l_emps EmpCurTyp;
    11      BEGIN
    12          l_emps := emp_obj_to_rows(p_emps);
    13          FETCH l_emps INTO e_rec;
    14          LOOP
    15              EXIT WHEN l_emps%NOTFOUND;
    16              INSERT INTO emp VALUES e_rec;
    17              FETCH l_emps INTO e_rec;
    18          END LOOP;
    19          CLOSE l_emps;
    20      END pop_emp;   
    21  END;
    22  /
    Package body created.
    SQL>Looks good. Let's see it in action...
    SQL> DECLARE
      2      newbies staff_nt :=  staff_nt();
      3  BEGIN
      4      newbies.extend(2);
      5      newbies(1) := emp_t(7777, 'APC', 'CODER', 7902, sysdate, 1700, null, 40);
      6      newbies(2) := emp_t(7778, 'J RANDOM', 'HACKER', 7902, sysdate, 1800, null, 40);
      7      emp_utils.pop_emp(newbies);
      8  END;
      9  /
    PL/SQL procedure successfully completed.
    SQL> SELECT * FROM emp WHERE deptno = 40
      2  /
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7777 APC        CODER           7902 17-NOV-05       1700
            40
          7778 J RANDOM   HACKER          7902 17-NOV-05       1800
            40
    SQL>     Cheers, APC

  • Convert an Object into a String

    Good day to everyone. I am trying to do a little coding in which a user will input his desired username. I want to check the database if the desired username of the current user is existing, so there'll be no duplication. I'm using JPA for the model and JSF for the controller and view.
    Here's my Model.
    @Entity
    public class WebUser implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        private Long id;
        private String lastName;
        private String firstName;
        private String middleName;
        private String username;
        private String password;
        public Long getId() {
            return id;
        public void setId(Long id) {
            this.id = id;
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (id != null ? id.hashCode() : 0);
            return hash;
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof WebUser)) {
                return false;
            WebUser other = (WebUser) object;
            if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
                return false;
            return true;
        @Override
        public String toString() {
            return "web.model.WebUser[id=" + id + "]";
        public String getLastName() {
            return lastName;
        public void setLastName(String lastName) {
            this.lastName = lastName;
        public String getFirstName() {
            return firstName;
        public void setFirstName(String firstName) {
            this.firstName = firstName;
        public String getMiddleName() {
            return middleName;
        public void setMiddleName(String middleName) {
            this.middleName = middleName;
        public String getUsername() {
            return username;
        public void setUsername(String username) {
            this.username = username;
        public String getPassword() {
            return password;
        public void setPassword(String password) {
            this.password = password;
    }The controller and jsp are auto-generated from Netbeans. My question is, how will I convert the 'WebUser' object into a String so I can compare the value from input text to the value in the database?
    Here is my validation method inside WebUserController.java
    public void validateUsername(FacesContext facesContext, UIComponent component, Object value) throws ValidatorException {
            String newUsername = (String) value;
            System.out.println("new user name: " +newUsername);
            System.out.println("component: " +component);
            int webUserSize;
            StringBuffer sb = new StringBuffer();
            //webUsers.toString();
            if ((webUsers == null) || (webUsers != null)) {
                System.out.println("web users null");
                List<WebUser> allWebUsers = getWebUsers();
                webUserSize = allWebUsers.size();
                System.out.println("all web users: " +allWebUsers);
                System.out.println("size " +webUserSize);
                for(int i=1; i<=webUserSize; ++i) {
                    sb.append(allWebUsers);
                    System.out.println("username: " +sb.append(allWebUsers));
            }Honestly I'm new to java and having a hard time with this one. Hope someone can help me. Thanks a lot.
    I know my code is a mess. :(

    Thanks for the help guys! I used the "unique constraint" annotation of JPA and my problem is solved.
    Here's the code:
    @Entity
    @Table(
        name="WebUser",
        uniqueConstraints={@UniqueConstraint(columnNames={"username"})}
    public class WebUser implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        private Long id;
        private String lastName;
        private String firstName;
        private String middleName;
        private String username;
        private String password;
        public Long getId() {
            return id;
        public void setId(Long id) {
            this.id = id;
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (id != null ? id.hashCode() : 0);
            return hash;
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof WebUser)) {
                return false;
            WebUser other = (WebUser) object;
            if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
                return false;
            return true;
        @Override
        public String toString() {
            //return "web.model.WebUser[id=" + id + "]";
            return "web.model.User[username=" + username +"]";
        public String getLastName() {
            return lastName;
        public void setLastName(String lastName) {
            this.lastName = lastName;
        public String getFirstName() {
            return firstName;
        public void setFirstName(String firstName) {
            this.firstName = firstName;
        public String getMiddleName() {
            return middleName;
        public void setMiddleName(String middleName) {
            this.middleName = middleName;
        public String getUsername() {
            return username;
        public void setUsername(String username) {
            this.username = username;
        public String getPassword() {
            return password;
        public void setPassword(String password) {
            this.password = password;
    }Thanks again guys!

  • How do I convert an Object into an Array?

    If I have an instance of type object that I know is really a DataGrid row that was cast into an object when passed to a function, how can I cast that Object to an array, such that each index of this array would correspond to the information in a given column of the row?

    @Sathyamoorthi
    Can you please explain what this function does? Essentially, what should be contained in the String?
    I printed out the string and it seems like I am getting a random row in the Object, as opposed to first or last. Why is that?
    UPDATE: I printed out the value of dataGrid0.columns[5].dataField but it just turned out to be the id of the column.

  • How can i convert JMS TextMessage into a String

    Please tell me,How can i convert A JMS TextMessage into a String

    http://java.sun.com/javaee/5/docs/api/javax/jms/TextMessage.html#getText()

  • Converting Array Objects into ArrayCollections

    Hi,
    I am facing problem with converting Array Objects into ArrayCollections. How can i convert Array Objects into ArrayCollections. If any one knows how can we do that Pl reply.
    Thanks in advance to all
    Regards
    subbareddy.p

    Hi Bhasker,
    thanks for u r reply. Here i attached screen shot of my server "data.result".
    My proxy varaible contains
    My object varaible "obj" contains
    After parsing the result my arraycollection contains, (i mean after converting Object to Array to ArrayCollection) the below information. For information Pl find the attached arraycollection.png image. In the attached image my arraycollection name is "users".
    Here i pasted the code that i used  to convert  "ObjectProxy" to "ArrayCollection"
    var proxy:ObjectProxy = ObjectProxy(data.result);
                var obj:Object = proxy.object_proxy::object;
                var arrycoll:Array = ArrayUtil.toArray(obj); 
                model.users = new ArrayCollection(arrycoll);
    Regards
    sss

  • How can I convert a layer into a smart object with Adobe Photoshop Elements 10?

    How can I convert a layer into a smart object with Adobe Photoshop Elements 10?

    That feature is only in PS. Elements as you buy it has only limited support for smart objects. If you use File>Place to add something to your image it will come in as a smart object (within the limits to which PSE understands smart layers). However, if you know someone who can write an action for you in PS you can install it in PSE, or you could look into something like elements+ from simplephotoshop.com.

  • How to convert Java Objects into xml?

    Hello Java Gurus
    how to convert Java Objects into xml? i heard xstream can be use for that but i am looking something which is good in performance.
    really need your help guys.
    thanks in advance.

    There are apparently a variety of Java/XML bindings. Try Google.
    And don't be so demanding.

  • How can i convert an object to stream of chars or bytes?

    how can i convert an object to stream of chars or bytes?

    One way is the serialization mechanism. There are examples and explanations of it in the Java tutorial: http://java.sun.com/docs/books/tutorial/essential/io/serialization.html

  • How can i convert 3d movie into 2d to watch it in mac

    i have a movie with mkv file playable on vlc how can i convert the movie into 2d

    There are now a bunch of them out there. Do a Google search for "mac 3D conversion" They tend to be around $35. I have been using iSkysoft products, which have been fairly easy to use. They have a "iMedia Converter Deluxe for Mac" that besides the 3D to 2D conversion, will also convert video to 70+ formats, has a 1-Click Video Downloader, and a single click Rip DVD and Burn to DVDs feature. Also claims to be "Ultrafast" all for the same price others apps are that only do the conversion.

  • How can I convert DVD- video into Apple's format so that it can be played and streamed from my Mac?

    How can I convert DVD- video into Apple's format so that I can play the content on my Mac and also stream it to my Apple TV? A few years ago, I transferred all of my home videos onto DVD but now would really like to put these onto my Mac and stream them through Apple TV to watch on the "big screen". Any advice would be most welcome!! Thanks

    MPEG Streamclip.
    Apple do not have their "own" format. You need to convert your DVDs to H.264 though.

  • How do i convert a pdf into a word file, i have tried doing save as?

    how do i convert a pdf into a word file, i have tried doing save as?

    Hi Jack,
    What version of Acrobat are you using?
    You might need to go to File> Save As Other> Microsoft Word or choose 'Adobe PDF printer' from the File menu.
    Is save as option not functioning correctly? Do you get any specific error?
    Please let me know.
    Regards,
    Anubha

  • How do i convert a pdf into an xls or csv file

    how do i convert a pdf into an xls or csv file   ? thnx

    HI newapiary
    You can either use Adobe Acrobat or Adobe ExportPDF Online Service.
    Please Refer : https://www.acrobat.com/exportpdf/en_GB/convert-pdf-to-word.html

  • HT4059 How can I convert a pdf into an ibook?

    How can I convert a pdf into an ibook? I've got a host of PDF's that I'd like to bring into the software but need a quick and simple tool to pull them through. Any ideas?

    In the help of Acrobat look for Form.

  • How do I convert à PDF file into my dairy?

    How do I convert à PDF file into my dairy?

    If I understand whatnyounare asking (and not sure I do), you may have a difficult time accomplishing that. Calendar app doesn't store documents and I don 't know of an app that will extract text from a PDF and place it in a calendar entry automatically. Check the app store - I could be wrong - but you will have to handle that manually.
    Many apps that read PDF will allow you to copy text, including GoodReader mentioned above.

Maybe you are looking for

  • Problem while Binding multiple Parameters to View Object[Solved]

    Hello, I am facing problem while binding multiple parameters with different data types in View Object query. For example suppose I have following query in my view object. SELECT Header.ADDED_BY Header.BATCH_ID, FROM BATCH_HEADER Header WHERE :1='dept

  • AirPort Express problem on MacBook Pro

    I'm having problems connecting to the internet via work place LAN while booted up in Lion.  Sometimes I can go into settings preferences or what ever that's called and get it to work by trial and error but it's very difficult.  Right now I'm using Ai

  • What are the Limitations of the Siebel Workflows ?

    Hello There, I'm doing a research about the limitations of Siebel workflows if you have any Ideas please share. Thanks

  • Compiler Error: Unable to load class

    Hi, I'm having trouble getting my first custom tag to work. Details of the setup follow: ============= Tag Handler ============= package whichtorrent.tags; import java.io.*; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; public class

  • I'm trying to organize LR4 lib for 1st time

    Hi,   I've installed LR4.  At installation, it created a Lightroom folder in my Pictures folder (I have an iMac).  Also inside the Pictures folder is a folder I created called Mike's LR Photos (I'm trying to follow Scott Kelby's book).  Within my "Mi