🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.comp.os.linux
Article #14011

linux��java����mysql������ʾ������֤����

#14011
From: youngtsin
Date: Thu, 22 Nov 2001 11:35
31 lines
1976 bytes
���˸��򵥵�linux��java����mysqlС����
����ʱ������ʾ������֤����
��ʵ���ڿ���̨���øÿ������ܹ�����
mysql������mydata��ݿ�ġ�
�����û���ΪmysqlĬ���е�guest��
����Ϊ�գ���ݿ�ΪĬ���е�test��
����������ϡ�
������ô���£�

�������£�
import java.sql.*;
public class java_mysql
{
   public static void main (String args[])
   {
        String driver = "org.gjt.mm.mysql.Driver";
 String url = "jdbc:mysql://localhost/mydata";
 String user = "myuser";
 String pw = "123456";
 try
        {
           Class.forName(driver);
           Connection conn = DriverManager.getConnection(url,user,pw);
 }
        catch (Exception e)
        {
    System.out.println("Connection failed:" + e.getMessage());
 }

   }
}
Technical Details
Message-ID: <9tinvk$6u1$1@mail.cn99.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!news.bentium.com!news.cn99.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: 10b277,ee127f6f90122c99,start
X-Google-Attributes: gid10b277,public
X-Google-ArrivalTime: 2001-11-22 03:36:24 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!news.bentium.com!news.cn99.com!not-for-mail
From: "youngtsin" <youngtsin@21cn.com>
Newsgroups: cn.comp.os.linux
Subject: linux��java����mysql������ʾ������֤����
Date: Thu, 22 Nov 2001 19:35:31 +0800
Organization: Bentium Ltd. (CN99)
Lines: 34
Message-ID: <9tinvk$6u1$1@mail.cn99.com>
NNTP-Posting-Host: 218.21.105.3
X-Trace: mail.cn99.com 1006428980 7105 218.21.105.3 (22 Nov 2001 11:36:20 GMT)
X-Complaints-To: usenet@news.cn99.com
NNTP-Posting-Date: Thu, 22 Nov 2001 11:36:20 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400