自學考試互聯網數據庫1-11章問答資料(7)

自學考試互聯網數據庫1-11章問答資料(7),第1張

自學考試互聯網數據庫1-11章問答資料(7),第2張

{

  public static void main(String argv[])

  {

  if(argv.length==0)

  {

  System.err.println(“檢查到空的URL!”); System.exit(1);

  }∥end of if

  try

  {

  Class.forName(“textFileDriver”);

  Class.forName(“jdbc.odbc.JdbcOdbcDriver”);

  Class.forName(“imaginary.sq1.iMsq1Driver”);

  String ur1=argv[0];

  String user,pwd;

  If(argv.length>1)

  {

  user=argv[1];

  }

  else

  {

  user=”” }

  If(argv.length>2)

  {

  pwd=argv[2];

  }

  else

  {

  pwd=”” }

  Connection con=DriverManager.getConnectiion(ur1,user,pwd);

  Con.close();

  System.out.println(“連接失敗!”); }∥end of try

  ∥処理連接異常 catch(Exception e)

  {

位律師廻複

生活常識_百科知識_各類知識大全»自學考試互聯網數據庫1-11章問答資料(7)

0條評論

    發表評論

    提供最優質的資源集郃

    立即查看了解詳情