public class RowSet2Xml
{
static
{
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
}
catch (Exception e)
{
e.printStackTrace();
}
}
public static void main(String[] args)
{
try
{
WebRowSet wrs = new WebRowSet();
wrs.setUrl("jdbc:microsoft:sqlserver://localhost:1433;databaseName=pubs");
wrs.setUsername("sa");
wrs.setPassword("");
wrs.setCommand("select * from employee");
// supply value for the parameter marker
//wrs.setInt(1,1);
// populate the rowset.
wrs.execute();