最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
果果来看(一个封装了基本JDBC操作的类)
时间:2022-11-14 23:26:39 编辑:袖梨 来源:一聚教程网
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
---------------------------------------------
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
相关文章
- 乱斗西游阵法怎么用 05-11
- 征服之歌最强的兵种是什么 05-11
- 以闪亮之名时尚对决弥夜长诗季怎么玩 时尚对决弥夜长诗季活动介绍 05-11
- 以闪亮之名星河坠梦版本有什么更新 星河坠梦版本更新内容介绍 05-11
- 以闪亮之名穿搭笔记分享码怎么用 穿搭笔记分享码功能介绍 05-11
- 哥伦布钱包官网中文版 05-11