用什么数据库,操作基本都一样的;
这是和MySql连接的程序:
import java.sql.*;public class DataConnection
{
Connection con=null;
public DataConnection()
{

                String url01="jdbc:mysql://192.168.0.9/bbs?user=root&password=&useUnicode=true&characterEndcoding=8859_1";
try
{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
con=DriverManager.getConnection(url01);
}
catch(Exception e)
{
System.err.println(e);
}
}


public void dataClose()
{
try
{
con.close();
}
catch(Exception e)
{
System.err.println("无法关闭数据库,发生异常:"+e);
}
}

public Connection getConnect()
{
return con;
}
}

解决方案 »

  1.   

    我有一本电子书<<MySQL And Java Developer Guide>>(PDF),大小3.33M,怎么给你
      

  2.   

    谢谢,我也想要,[email protected]
      

  3.   

    我也要,
    [email protected]
      

  4.   

    [email protected]或者QQ:61182831。火急中!
      

  5.   

    楼上的兄弟,给我发一份吧,谢谢啦!![email protected]
      

  6.   

    [email protected]
    先行谢过!!
      

  7.   

    我也要 [email protected]  谢谢了!!!!!!
      

  8.   

    对不起,回来晚了。
    已发送至如下E-mail,望查收。
    [email protected]
    [email protected]
    [email protected]
    [email protected] 
    [email protected] 
    [email protected] 
    [email protected]