| | |
I need an exampls program in java to store image datatype in ms-sql
Please support our MS SQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2004
Posts: 1
Reputation:
Solved Threads: 0
Hi,
I need an exampls program in java to store image datatype in ms-sql database.i am writing a jsp file in that i wanted attach a file.in oracle i wriiten like this,but i need in ms-sql.i required urgently.pls help me.
code in java using oracle.
i need it in ms-sql.
public ArrayList save(com.virinchi.capture.attachment.FileAttachment fileAttach)
{
FileHandler fh = getFileHandler();
int iCount=0;
int iSize=fileAttach.getFiles().getCount();
ArrayList attachmentIds=new ArrayList();
String folder = fileAttach.getRequest().getParameter("Folder");
try
{
for (iCount=0;iCount<iSize;iCount++)
{
String fileName ="";
String fileSize="";
com.virinchi.capture.attachment.File myFile = fileAttach.getFiles().getFile(iCount);
InputStream file = myFile.getFileInputStream();
byte[] bt = new byte[file.available()];
file.read(bt);
ByteArrayInputStream bais = new ByteArrayInputStream(bt);
fileName=myFile.getFileName();
fileSize=myFile.getSize()+"";
String s[]= new String[4];
if (fileName.length()==0 || myFile.getSize()==0)
{
System.out.println("Empty File");
}
else
{
s[0]=fh.save(fileName,fileSize,bais);
s[1]=fileName;
s[2]=fileSize;
s[3]=folder;
attachmentIds.add(s);
}
}
}
catch(Exception e)
{
}
return attachmentIds;
}
regards,
santoshmaya
I need an exampls program in java to store image datatype in ms-sql database.i am writing a jsp file in that i wanted attach a file.in oracle i wriiten like this,but i need in ms-sql.i required urgently.pls help me.
code in java using oracle.
i need it in ms-sql.
public ArrayList save(com.virinchi.capture.attachment.FileAttachment fileAttach)
{
FileHandler fh = getFileHandler();
int iCount=0;
int iSize=fileAttach.getFiles().getCount();
ArrayList attachmentIds=new ArrayList();
String folder = fileAttach.getRequest().getParameter("Folder");
try
{
for (iCount=0;iCount<iSize;iCount++)
{
String fileName ="";
String fileSize="";
com.virinchi.capture.attachment.File myFile = fileAttach.getFiles().getFile(iCount);
InputStream file = myFile.getFileInputStream();
byte[] bt = new byte[file.available()];
file.read(bt);
ByteArrayInputStream bais = new ByteArrayInputStream(bt);
fileName=myFile.getFileName();
fileSize=myFile.getSize()+"";
String s[]= new String[4];
if (fileName.length()==0 || myFile.getSize()==0)
{
System.out.println("Empty File");
}
else
{
s[0]=fh.save(fileName,fileSize,bais);
s[1]=fileName;
s[2]=fileSize;
s[3]=folder;
attachmentIds.add(s);
}
}
}
catch(Exception e)
{
}
return attachmentIds;
}
regards,
santoshmaya
![]() |
Similar Threads
- how to store image data into OLE object datatype of ms access database (ASP.NET)
- how to create a simple chatting program in java (Java)
- How to Store Image in Oracle 9i using VB6 (Visual Basic 4 / 5 / 6)
- how to store and retreive images from MS SQL Serer (VB.NET)
- creating an instant messenger program in java (Java)
- creating an instant messenger program in java (Java)
- can we write linlist program in java (Java)
Other Threads in the MS SQL Forum
- Previous Thread: ASP and SQL ?
- Next Thread: Ms Sql 2000
Views: 9761 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for MS SQL
"last age autogrowth business connectingtodatabaseinuse count cursor data database dateadd datediff datepart day" dbsize deadlock delete_trigger exploit getdate hack highperformancecomputing hpc hpcserver2008 ibm iis limit live loop maximum microsoft ms mssql multiple multithreading news number password permission position query reporting result security server services sets single source sql sql-injection sqlserver sqlserver2005 subtype supercomputing supertype tables uniqueid update view weekday





