Ve Ne

Greenhorn
+ Follow
since May 26, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ve Ne

I have a longraw column in my Oracle Database. I converted it into Image Datatype in SQL Server...Now I wanna extract the files into my NT Folder. This is what I wrote. All microsoft files are opening (xls,doc,mpp,txt) but no pdf,jpg,bmp files are opening. Pls. help! what am i missing here? Is it because I converted Oracle Longraw to SQL server Image datatype or is something in the Java code missing or Java cannot handle?
***********************
import java.sql.*;
import java.io.*;

public class binext{
public static void main(String[] args) throws Exception{

String url = "jdbc:microsoft:sqlserver://<server name>DatabaseName=<Name>";
String uid = "<UID>";
String pw = "<password>";

try {// Load driver class
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
}
catch (java.lang.ClassNotFoundException e) {
System.err.println("ClassNotFoundException: " +e);
}
String Query;
int FileLength;
Connection cn;
ResultSet rs;
int file_id_seq;
String FileName;

file_id_seq = Integer.parseInt(args[0]);
FileName = args[1];

//instantiate the class
FileDBTransfer fdb = new FileDBTransfer();

Connection con = null;

con = DriverManager.getConnection(url,uid,pw);
rs = fdb.getRS(con,"SELECT document_data FROM sar_fac_file_cabinet where file_id_seq=" + file_id_seq);
fdb.getBinaryFile(args[1], rs);
con.close();

}//end main
}
[ June 02, 2005: Message edited by: Bear Bibeault ]