Results 1 to 2 of 2
  1. #1
    computerbum is offline Member
    Join Date
    Feb 2010
    Posts
    26
    Rep Power
    0

    Default Formatting String data from database

    Hello everyone,

    I have been searching for days with no help on how to format my data that I have retrieved from one of my tables. Here is the statement I am using:

    Java Code:
                    System.out.format( 
                            "| " + prodNum   +
                            " \t"+ prodBrand + "   " +
                            " \t"+ prodModel + " \t" +
                            " \t"+ modelNum  + " \t" +
                            " \t"+ prodID    + " |\n");

    And this is how it comes out:

    Java Code:
    Product Table
    -------------
    
    | 1 	Dell    	Inspiron 	 	1 	 	L342DP |
    | 2 	Apple    	NetBook 	 	1 	 	LM42RX |
    | 3 	IBM    	ProSeriesII 	 	3 	 	S342TB |
    | 4 	HP    	touch 	 	3 	 	P545TB |
    | 5 	Acer    	ProDesk 	 	3 	 	D300RC |

    Now, my question is how do I format all the data without using a gui?

    I could really use some help on this because I am having no luck. If anything point me in the right direction.

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    You got a reply already, which you have ignored:
    String and number formatting

    And this is not a Database question, it doesn't matter where the Strings come from.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

Similar Threads

  1. String and number formatting
    By computerbum in forum New To Java
    Replies: 1
    Last Post: 04-27-2010, 05:06 PM
  2. Formatting String
    By ersachinjain in forum Advanced Java
    Replies: 13
    Last Post: 10-21-2009, 09:26 PM
  3. [SOLVED] Getting Data from a database
    By AJG in forum New To Java
    Replies: 8
    Last Post: 04-04-2008, 12:52 PM
  4. Data formatting for the <display:table>
    By yuchuang in forum Web Frameworks
    Replies: 3
    Last Post: 12-14-2007, 10:52 AM
  5. formatting String
    By bugger in forum New To Java
    Replies: 1
    Last Post: 11-16-2007, 07:27 PM

Posting Permissions

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