Hello Friends, I am working on a form and using servlet to submit data into database. I am using simple JDBC-ODBC bridge and using MS-Access as databse. In my table their is one column with field type "memo" which can hold upto 65,535 chractes. When from my form i am inserting values in this column it is only accepting a string of lenght 256 char and not more. Why is it behaving in such way? Can any one help me in this. I have posted this query here because lot of user in this forum must be using Servlet-JDBC and i think i will get my answer here. Am i right? thanks, regards, Raj.
Regards,<P>Raj.<BR>-------------------------<BR>Afforts should be Appriciated.<BR>-------------------------
i guess u might be using GET method in your form. check for it, n if yes change it to POST. am i rite folks?
Joined: Aug 26, 2000
Hello, No the pb is not with the type of method i have choosen. I am using doPost method. I am getting error when it is inserting data in the database. It is inserting data correctly for all other type of column fields. that is text, number, date/time, autonumber. Only for memo field it is only accepting upto 256 characters and nothing more than that. It gives me following erroe java.sql.SQLException String Data, right Truncated (null). It is a MS-ODBC error.
How to sole it. Any one pls help me? Regards, Raj.
My guess would be that this has nothing to do with servlets... It has alot to do with your jdbc driver... Walk thru the following and you might find your problem... #1 what are the java data types you are using... #2 what are the sql data types you are using... #3 what are the db engine datatypes you are using... My guess is that the jdbc driver being invoked is translating you memo field into a text field... my ms-acces is rusty so bear with me. Test you code outside of the servlet.... If it works as you expect... Check you CLASSPATH. You are invoking a different jdbc driver.... Otherwise you have just found a limitation of your database driver! Good-luck you a blazing a trail i will be following next week.
------------------ We learn more from our mistake's than from our success's. a.k.a. monty6
Memo fields are wierd in Access. They cause all sorts of problems with the JDBC-ODBC driver unless you use the stream method of accessing them. To read from a Memo field, use InputStream in = resultset.getAsciiStream(int column) or InputStream in = resultset.getAsciiStream(String colname) I have never had to write to a memo field, but I assume the process is similar.