package gov.va.med.ars.client;

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

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

/*	String driver = "weblogic.jdbc.mssqlserver4.Driver";
	String url = "jdbc:weblogic:mssqlserver4:Northwind@SQLServer1";*/

	String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
	//String url = "jdbc:sqlserver://0.0.0.0:1433;databaseName=ARS;user=sa;password= PW_redacted";
	
	//String url = "jdbc:sqlserver://IP___ADDRESS\\BSM;databaseName=Claim_Attachments;user=DNS   panicv;password=PW_redacted";
	
	String url = "jdbc:sqlserver://DNS   sksql80.aac.dva.DNS   ;databaseName=Claim_Attachments;user=ArsUser;password=PW_Redacted";
	
	//String login = "sa";
	//String pwd = "PW_Redacted";
	
	String login = "ArsUser";
	String pwd = "PW_Redacted";
	
	String Query;
	int FileLength;
	Connection cn;
	ResultSet rs;;
	//int id;

	//id = Integer.parseInt(args[0]);
//	WeekNum  = Integer.parseInt(args[1]);

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

		cn = fdb.getConnection(driver, url, login, pwd);
		
		//insert files to database
		fdb.insertFile(fdb, cn, args[0]);
		cn.close();
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

}//end main
}
