•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 397,703 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,426 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 6993 | Replies: 0
![]() |
•
•
Join Date: Jun 2004
Posts: 1
Reputation:
Rep Power: 0
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
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
- creating an instant messenger program in java (Java)
- Can I make a Java Image Editing Photshop-like program (Java)
- cheeky java program (Java)
- hijacked web browser (prosearching.com) (Viruses, Spyware and other Nasties)
Other Threads in the MS SQL Forum
- Previous Thread: ASP and SQL ?
- Next Thread: Ms Sql 2000


Linear Mode