package gov.va.med.ars.client;

import java.sql.*;
import java.io.*;

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

/*	String driver = "weblogic.jdbc.mssqlserver4.Driver";
	String url = "jdbc:weblogic:mssqlserver4:Northwind@SQLServer1";*/
	
	String driver = "weblogic.jdbc.mssqlserver4.Driver";
	String url = "jdbc:weblogic:mssqlserver4:Northwind@SQLServer1";
	
	
	String login = "sa";
	String pwd = "";
	String Query;
	int FileLength;
	Connection cn;
	ResultSet rs;;
	int CompanyID;
	int WeekNum;
	String FileName;

	CompanyID = Integer.parseInt(args[0]);
	WeekNum  = Integer.parseInt(args[1]);
	FileName = args[2];

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

	cn = fdb.getConnection(driver, url, login, pwd);
	
	rs = fdb.getRS(cn, "SELECT ZipFile FROM ReportArchive WHERE CompanyID =" +CompanyID+ "AND Week =" + WeekNum);
	//fdb.getBinaryFile(args[2], rs);


 	cn.close();

}//end main
}
