Greg,
You need to check how your table was created and examine the datatype used
for the field that you want to store the large string in.  If it is of the
CHAR or VARCHAR types, it is probably limited to 255 characters.(DB
dependent) In that case, you might want to change it to another SQL
datatype that can handle the size of the text field you want to handle
(TEXT, TINYTEXT, CLOB, BLOB, etc.)

-Richard


At 10:59 AM 8/31/01 -0500, you wrote:
>I appreciate all of your help... I finally got the prepared statement down
>through all your help.. However, it is still choking on a LONG string.  It
>inserts strings with any kind of character (which was a problem before),
>but it wont update a string that is very large.  Any suggestions?  I hope
>I am not abusing the list by making so many posts, but you guys have been
>my best resource.  Code is below...
>Thanks, Greg Price
>
>
>
><%@ page language="java" import="java.sql.*, java.util.*" %>
><% String heading= request.getParameter("heading"); %>
><% String entry= request.getParameter("entry"); %>
>  String sqlQuery = "INSERT INTO news (newsletter_ID,  heading,
> entry)   VALUES (?, ?, ?) ";
>
>  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>  String url="jdbc:odbc:afdallas";
>  Connection c=DriverManager.getConnection(url, "sa", "");
>      try {
>         PreparedStatement pstmt = c.prepareStatement(sqlQuery);
>
>pstmt.setInt(1,Integer.parseInt(request.getParameter("newsletter_ID").trim())
>);
>         pstmt.setString(2, heading.trim() );
>         pstmt.setString(3,  entry.trim() );
>         pstmt.executeUpdate();
>         pstmt.close();
>         c.close();
>
>     } catch(Exception exc) {
>System.out.println("Error: "+exc);
>     }%>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to