The moose likes HTML, CSS and JavaScript and the fly likes How to wrap text coming from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to wrap text coming from database " Watch "How to wrap text coming from database " New topic

How to wrap text coming from database

yoga babu

Joined: Jul 18, 2006
Posts: 17
Hai friends,

I am taking datas from database table and dispalying as a report using jsp,servlet.i have URL field ,its having more than 50chracter,so in report this particular field is so i want to wrap text into 2 or 3 lines.

Connection con=DriverManager.getConnection("jdbcdbc:pro","pr","pr");
Statement stat = con.createStatement();
ResultSet rs = stat.executeQuery ("SELECT * FROM BL_BILL WHERE startdate BETWEEN '"+sta+"' AND '"+sta1+"' ");

<table border="2" >

<td><font color="green" size=2>URL</td>
String url =rs.getString(1);

<td><font size=2 color="black"><%= url %></td>

pls suggest me how to make url field into 2 lines.

Thank You

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

There is nothing in JSP for doing this.
The solution would be to use HTML or CSS.

Moving to HTML/Javascript.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: How to wrap text coming from database
It's not a secret anymore!