设为首页 加入收藏

TOP

一个关于过程的源码
2014-11-23 14:40:36 】 浏览:8799
Tags:一个 关于 过程 源码

  一个关于过程的源码


  /*
  * 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()


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Java解析XML文件的四种方法 下一篇一种高效的javabea分页ForSqlServ..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目