import java.sql.*; import javax.sql.*; public class xatest { public static void main(String[] args) throws Exception { XAConnection con = null; Connection handle = null; CallableStatement proc_stmt = null; try { com.sun.sql.jdbcx.sqlserver.SQLServerDataSource ds = new com.sun.sql.jdbcx.sqlserver.SQLServerDataSource(); //ds.setServerType("dedicated"); ds.setPassword("dbpassword"); ds.setPortNumber(1433); ds.setUser("dbuser"); ds.setServerName("129.145.133.124"); ds.setDatabaseName("dbsmpl1"); con = ds.getXAConnection(); handle = con.getConnection(); proc_stmt = handle.prepareCall("{ call ADDDISH(? , ?) }"); proc_stmt.setString(1, "BBQ ribs"); proc_stmt.setString(2, "BBQ and ribs"); int rt = proc_stmt.executeUpdate(); System.out.println("Execution Return : " + rt); } catch (SQLException ex) { ex.printStackTrace(); } finally { try { proc_stmt.close(); handle.close(); con.close(); } catch (SQLException ex) { ex.printStackTrace(); } } } }