Article View: alt.lang.basic
Article #584Re: Storing JPEGs in a SQL Server database
From: Andreas Pohlke
Date: Wed, 27 Nov 1996 00:00
Date: Wed, 27 Nov 1996 00:00
38 lines
2726 bytes
2726 bytes
John A. Simpson wrote: > I need some code or information on how to store JPEG graphic files in a SQL > Server database. Any help would be greatly appreciated. It depends on how you access the DBS. The IMAGE datatype stores "something binary" and does not determine the file format. There are ways to use an INSERT to insert the binary data with a string and SELECT returns an amount of binary data. In JDBC/ODBC the type TEXT is handled with Sting types, which are interpreted as being binary data too (according to Transact SQL). Try to insert data by giving a String type which contains the raw data. Vice versa, try to fetch the image data into a String. Use stored procedures to encapsulate the transaction? (How to cast a String to an image container is yet another problem...and depends on your access method.) (For hints on MS Acces read the other replies.) In the near future we are going to have these problems using JBBC/ODBC to store GIF/JPEG images in MS SQL-Server 6.5 (these formats, since Java supports them). I'll keep your question in mind. Greetings, Andreas. -- Andreas Pohlke Siemens AG, PN GS 375 Andreas.Pohlke@pn-msmail.bln.siemens.net Berlin S Intranet: http://198.7.1.105 Tel: (+49 30) 386 27610 "Der Daten sind genug gewechselt - nun lasst Informationen folgen!" -- Andreas Pohlke Free University of Berlin pohlke@inf.fu-berlin.de Insitute of Computer Sciences http://www.inf.fu-berlin.de/~pohlke Berlin, Germany "Superstition brings bad luck"
Technical Details
Message-ID:
<329C540A.3E95@pn-msmail.bln.siemens.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<57eup0$ist@twain.mo.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10c949,8d045e4ddf7c3eaf X-Google-Attributes: gid10c949,public X-Google-Thread: 104de1,8d045e4ddf7c3eaf X-Google-Attributes: gid104de1,public X-Google-Thread: f6611,8d045e4ddf7c3eaf X-Google-Attributes: gidf6611,public X-Google-Thread: 10ab99,8d045e4ddf7c3eaf X-Google-Attributes: gid10ab99,public X-Google-Thread: 110e3b,8d045e4ddf7c3eaf X-Google-Attributes: gid110e3b,public X-Google-Thread: 11355a,8d045e4ddf7c3eaf X-Google-Attributes: gid11355a,public From: Andreas Pohlke <Andreas.Pohlke@pn-msmail.bln.siemens.net> Subject: Re: Storing JPEGs in a SQL Server database Date: 1996/11/27 Message-ID: <329C540A.3E95@pn-msmail.bln.siemens.net> X-Deja-AN: 201047072 references: <57eup0$ist@twain.mo.net> content-type: text/plain; charset=us-ascii organization: Siemens AG mime-version: 1.0 reply-to: Andreas.Pohlke@pn-msmail.bln.siemens.net newsgroups: alt.lang.basic,bit.databases.mssql-l,bit.listserv.sqlinfo,comp.lang.basic.misc,comp.lang.basic.visual.misc,comp.databases.ms-sqlserver x-mailer: Mozilla 3.0 (WinNT; I)