www.webdeveloper.com
Results 1 to 3 of 3

Thread: Xml not outputting data properly

  1. #1
    Join Date
    Jul 2007
    Posts
    183

    Xml not outputting data properly

    Problem fixed. can a mod delete this thread.
    Last edited by Shaolin; 09-04-2008 at 02:34 PM.

  2. #2
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    Your error checking's not returning any failures. At a basic, you can change this block of code

    Code:
    try {
    	while (rs.next()) {
    		userId = rs.getString("user_id");
    		fname = rs.getString("first_name");
    		lname = rs.getString("last_name");
    		address = rs.getString("add1");
    		
    		Contacts contact = new Contacts();			//Create Class object
    		contact.setDetails(userId,fname,lname,address);		//Set details into object
    		contacts.add(contact);								//Place object into list				
    	} rs.close();
    } catch(SQLException ex) {ex.toString();}
    to
    Code:
    try {
    	while (rs.next()) {
    		userId = rs.getString("user_id");
    		fname = rs.getString("first_name");
    		lname = rs.getString("last_name");
    		address = rs.getString("add1");
    		
    		Contacts contact = new Contacts();			//Create Class object
    		contact.setDetails(userId,fname,lname,address);		//Set details into object
    		contacts.add(contact);								//Place object into list				
    	} rs.close();
    } catch(SQLException ex) {
    System.err.println("**** sql exception begin ****");
    ex.printStackTrace(System.err);
    }
    Then take a look at wherever your system.err is pointing to.
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

  3. #3
    Join Date
    Jul 2007
    Posts
    183
    Thanks chazzy. I am in need of some more advice if you dont mind. Since my app is being developed with ajax, building pages using dom is way too long, so instead I have a servlet request which basically spits out the required html and then I use innerHTML to insert to content into to page. With dynamic content I use XML/DOM to build the tables/divs and then insert them into the html. The servlet processes both the html/xml GET requests. Now, does this sound like a good way of doing things ?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles