设为首页 加入收藏

TOP

果果来看(一个封装了基本JDBC操作的类)
2011-06-09 13:00:33 来源: 作者: 【 】 浏览:91次 评论:0
odbc.java
---------------------------------------------
package bbs;
/*
database operation class, test by odbc
This javabean is written by zergling
It is my first javabean :o
version 1.01
*/
import java.sql.*;
import java.lang.*;
import java.io.*;
import java.util.*;
import sun.io.*;
public class odbc
    {
    Connection sqlCon;
    ResultSet rstSql;
    Statement stmS;
    String strCon;
    String strSql;
    boolean status;
    long rowcount;
    int page;
    int pagesize;
    long pagecount;
    long firstrecord;
    //connect to the default database
    public boolean connect()
        {
        //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        this.strCon = "jdbc:odbc:jspbbs";                                                  //replace with your default database
        try
            {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            this.sqlCon = java.sql.DriverManager.getConnection(this.strCon,"sa","");    //replace with your default database connection configure option
您看到此篇文章时的感受是:
Tags: 责任编辑:administrator
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到QQ空间
分享到: 
上一篇看看String类的构造方法 下一篇C#就是Java只不过差了一点点

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

相关栏目

最新文章

图片主题

热门文章

推荐文章

相关文章

广告位