一个关于过程的源码 |
|
www.nanhushi.com 佚名 不详 |
一个关于过程的源码 /* * 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()
|
|
|
文章录入:杜斌 责任编辑:杜斌 |
|
上一篇文章: 用C语言实现常见的三种中文内码转换 下一篇文章: 一种高效的javabea分页ForSqlServer |
【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |
|
|