I know this is an old error. I looked everywhere but still couldn't find the solution. Stackoverflow is my last resort.
Here is what I am doing. I am trying to import a txt file through java into SQL server 2008.
The code I wrote for doing this task is
public static void main(String[] args)throws Exception {
try
{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection con=DriverManager.getConnection("jdbc:sqlserver://SMS-GIGO-IDEN:1433; datbaseName=Testing","sa","paswword");
Statement stmt = con.createStatement();
ResultSet rs= stmt.executeQuery("Bulk INSERT Testing.dbo.Link from '\\SMS-GIGO-IDEN\\fa2\\Benchmark\\Output\\B20.link' with (FIELDTERMINATOR='\t', FIRSTROW=2)");
}
catch(Exception e)
{
e.printStackTrace();
}
As you can see I have already shared the folder on which I am storing the file. Also, I am using the Machine name.
Note: To check if the machine name is working I accessed SMS-GIGO-IDEN from another machine's SQL server and Bulk is working fine their. In Short BULK QUERY is working from SQL server of any machine. However, Its not working from net beans.
SMS-GIGO-IDEN is a SQL server database and I am running netbeans from the same server where the database is located.
I am loging into SMS-GIGO-IDEN using Windows Authentication. Since I created a SQL server Connection I am not using Windows Login credentials. I created another one as can be seen in my connection string.
So, Is there any one out there who experienced the same thing?
Thanks.