Forums Register Login

Problem with JDBC

+Pie Number of slices to send: Send
Hi,
I am using Stored procedure to access a table in Sql Server
7.0.I have a text datatype for one of the fields in the table.
When i access the field for insert using cs.setString()with say
1MB of text the server throws exception. When i use
cs.setAsciiStream instead of cs.setString , am getting exception
when i access the output param. I think this may be a driver
problem. I would like to know whether any of them come accross
this problem and solved it. Any suggesions will be a great help
for me. I have also given the coding below.

Thanks
syed
[ Edited by Dave to format code ]
[This message has been edited by David O'Meara (edited December 06, 2001).]
+Pie Number of slices to send: Send
Two things, if you try using the JdbcOdbcDriver you will always run in trouble. It doesn't implement all JDBC methods and it isn't very stable.
Secondly: My view (and I'm no DBA) is don't put a 1Mb file in the database. Personally I'd store a reference to where the file is stored externally or something.
Dave.
+Pie Number of slices to send: Send
sent via email:

Hi david,
I got ur reply. Thanks for responding. Since i get the text from the form(its a description field) and storing it in the DB, there is no chance for storing it in the file. And more over there will be no security. If say am storing some 10000 recs then managing my files will become hectic problem.

Thanks
syed


(Sorry I can't usually reply via email, and it means no-one else can get a say )
If you are getting the data via a HTML form, you can either use a multipart/form-encoded upload, save it to the local file system and save the filename in the db, or receive the data as a form field, write it as a unique file name (since you control the data) and once again save the file name in the DB.
The other problem I've seen that you may run into if you try to store the data direct top the DB is that there are often still upper limits on how large LOB types can be (32k or so? I can't remember)
Dave.
Think of how dumb the average person is. Mathematically, half of them are EVEN DUMBER. Smart tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 831 times.
Similar Threads
Can not find server or DNS error
Having trouble setting up JSP engine
servlets using JDBC
jsp and beans
calling a stored procedure in Jsp
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 04:21:11.