This discussion is archived
0 Replies Latest reply: Mar 25, 2013 12:43 PM by mlvenkatesh RSS

Using java to execute distributed queries SQL server DB

mlvenkatesh Newbie
Currently Being Moderated
Hi all,

Need to extract all the records in a SQL server DB table and store in a excel file. Am trying to use distributed query
insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0',
    'Excel 8.0;Database=c:\temp\exported_data.xls;',
    'SELECT * FROM [TEST$]') SELECT * FROM dbo.table_name
I have requsted for rights to perform this query.

The question is can i execute this query from java through the standard JDBC application program interfaces (APIs) using sqljdbc.jar?

I would have tried this but am waiting for the rights to execute distributed queries


Regards,
Venk

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points