一个关于过程的源码
/*
* Created on 2004-7-22
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
/**
* @author cw
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
import java.awt.*;
import javax.Swing.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
public class ProcedureExample1 extends JFrame {
private Statement stam;
private Connection con;
private ResultSet resultSet;
private ResultSetMetaData rsMetaData;
public JButton bty;
public JLabel lb1;
public JButton btsave;
public JTable table;
public ProcedureExample1()
{
super("关于存储过程");
String url="JDBC:jtds:sqlserver://192.168.254.222:1433/currentdb";;
String user="sa";
String password="";
try{
/* Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
con=DriverManager.getConnection("jdbc:microsoft:sqlserver://hxdz05:1433;databaseName=currentdb",user,password);
*/
Class.forName("net.sourceforge.jtds.jdbc.Driver").newInstance();
con= DriverManager.getConnection(
url, user, password );
}
catch(ClassNotFoundException cnfex){
System.err.println("装载JdBC驱动程序失败!");
cnfex.printStackTrace();
System.exit(1);
}
catch(SQLException sqlex){
System.err.println("无法连接数据库");
sqlex.printStackTrace();
System.exit(1);
}
catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//catch()