• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with JDBC

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic