Re: using BLOB objects and ...



you can insert any kind of file to database by using following code
i hope this program will usefull for you

Example on storing images into BLOB data type.
- Managing SQL 92 data types (BLOB, CLOB and Ref)
BLOB (Binary Large OBject)
Used to store binary informations like images, audio files etc
-For each byte one byte of memory will be allocated
-Size can vary up to 4GB for each entry
CLOB (Character LOB)
-Used to store character information like plain, word documents
-For each character two bytes of memory is allocated
-Size up to 4GB
Ref (Reference):
-The column declared with this data type instead of storing a file into
DB contains
a pointer pointing to the file located in the hard disk
-Size up to 4GB
*/
// ImageStore.java
import java.sql.*;
import java.io.*;
public class ImageStore
{
public static void main(String rags[]) thro

ws Exception
{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:mysqlDSN","root",
"active");
PreparedStatement pstmt=con.prepareStatement("insert into temp
values(?,?)");
File f=new File("xml-pic.jpg");
FileInputStream fis=new FileInputStream(f);
pstmt.setInt(1, 1);
pstmt.setBinaryStream(2, fis, (int)f.length());
int i=pstmt.executeUpdate();
System.out.println(i+" record inserted");
pstmt.close();
con.close();
}// main()
}// class

ali wrote:
Hi there well i am having a problem in one of my current projects and
it is that

i have to insert an 4 dimention array into a database and the best
thing i was adviced until now is to use a BLOB, but BLOB is just an
interface in java.sql.* so how can i create an object of Blob and
again how i can insert my 4d array to it.

.



Relevant Pages

  • RE: How to make your SQL Server database grow exponentially with linear data
    ... > We have this database that we use to collect 1000's of rows of data a day. ... > SQL Server reports no free space. ... turns out the problem are with the blob fields. ... > and inserted a new row we probably would have been able to shrink the ...
    (microsoft.public.sqlserver.server)
  • How to make your SQL Server database grow exponentially with linear data
    ... We have this database that we use to collect 1000's of rows of data a day. ... SQL Server reports no free space. ... turns out the problem are with the blob fields. ... of a bigger blob, but they are much lower on the exponential curve than the ...
    (microsoft.public.sqlserver.server)
  • Re: Blobs and SQL Server
    ... Older versions of SQL Server required the blob be loaded in chunks, ... There is a cpu and disk IO hit while inserting the blob. ... Director of Text Mining and Database Strategy ... If a large file is inserted, then it will require many small chunks. ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Hello: not so much php, more like HTML..?
    ... Jerry would tell you to just serve them up straight from the database, and forget about the filesystem, I'm not so sure:). ... I suspect the answer is that for n files, us the pth root of n as the number of subdirs, where p is the depth of the subdirs...but a lot depends on caching algorithms in the directories. ... I shudder to think how long adding slashes to a 60Mbyte binary image might take, or indeed how much virtual memory holding it in a 60Mbyte php string might use.. ... Anyone ever handled BLOB objects that large, ...
    (comp.lang.php)
  • Re: Historical research software, old and new
    ... No problem, disk space is cheap. ... And if you're going to store it it will still occupy the space whether it's in a file or a database BLOB. ... So you'd enter the Repository first and link all the Sources for that Repository as you came by them. ...
    (soc.genealogy.computing)