没有!
import java.io.*;
import java.sql.*;
import oracle.jdbc.driver.OracleDriver;public class db implements Serializable{
static Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
public static void getConnection(){
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
conn=DriverManager.getConnection("jdbc:oracle:oci8:@jimes","test","test");
}
catch(ClassNotFoundException e){
System.out.println("ClassNotFound"+e.getMessage());
}
catch(SQLException se){
System.out.println("getConnection"+se.getMessage());
}
}
public void closeConnection(){
try{
if(conn!=null)
conn.close();
if(stmt!=null)
stmt.close();
if(rs!=null)
rs.close();
}
catch(SQLException se){
System.out.println("close"+se.getMessage());
}
rs=null;
stmt=null;
conn=null;
}
public ResultSet executeQuery(String sql){
rs=null;
try{
if(conn==null)
getConnection();
if(conn!=null){
stmt=conn.createStatement();
rs=stmt.executeQuery(sql);
}
}
catch(SQLException se){
System.out.println("executeQuery"+se.getMessage());
}
return rs;
}
public boolean executeUpdate(String sql){
boolean bupdate=false;
try{
if(conn==null)
getConnection();
if(conn!=null){
stmt=conn.createStatement();
int rowCount=stmt.executeUpdate(sql);
if(rowCount!=0)
bupdate=true;
}
}
catch(SQLException se){
System.out.println("executeUpdate"+se.getMessage());
}
return bupdate;
}
public static String toChinese(String strvalue){
try{
if(strvalue==null){
return null;
}
else{
strvalue=new String(strvalue.getBytes("ISO-8859-1"),"GBK");
return strvalue;
}
}
catch(Exception e){
return null;
}
}
}
import java.io.*;
import java.sql.*;
import oracle.jdbc.driver.OracleDriver;public class db implements Serializable{
static Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
public static void getConnection(){
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
conn=DriverManager.getConnection("jdbc:oracle:oci8:@jimes","test","test");
}
catch(ClassNotFoundException e){
System.out.println("ClassNotFound"+e.getMessage());
}
catch(SQLException se){
System.out.println("getConnection"+se.getMessage());
}
}
public void closeConnection(){
try{
if(conn!=null)
conn.close();
if(stmt!=null)
stmt.close();
if(rs!=null)
rs.close();
}
catch(SQLException se){
System.out.println("close"+se.getMessage());
}
rs=null;
stmt=null;
conn=null;
}
public ResultSet executeQuery(String sql){
rs=null;
try{
if(conn==null)
getConnection();
if(conn!=null){
stmt=conn.createStatement();
rs=stmt.executeQuery(sql);
}
}
catch(SQLException se){
System.out.println("executeQuery"+se.getMessage());
}
return rs;
}
public boolean executeUpdate(String sql){
boolean bupdate=false;
try{
if(conn==null)
getConnection();
if(conn!=null){
stmt=conn.createStatement();
int rowCount=stmt.executeUpdate(sql);
if(rowCount!=0)
bupdate=true;
}
}
catch(SQLException se){
System.out.println("executeUpdate"+se.getMessage());
}
return bupdate;
}
public static String toChinese(String strvalue){
try{
if(strvalue==null){
return null;
}
else{
strvalue=new String(strvalue.getBytes("ISO-8859-1"),"GBK");
return strvalue;
}
}
catch(Exception e){
return null;
}
}
}
解决方案 »
- canvas 在SplitPanel上拖动的问题
- 小菜奔泪啊、求大虾大婶帮看下我的代码错我,我咋就不会改呢?
- JTable中关于某一行某一些字段设置为可编辑
- 一道java难题
- ObjectInputStream类和ObjectOutputStream类问题,高手指教啊!
- 关于Number的想法
- 寻求一个算法~!
- 不用JDBC-ODBC Bridge,可以连接MS SQL Server 2000吗?
- 请教高手,大撒分!欢迎指点。。。
- 为啥我的Javaswing窗口里的jtable里的滑轮和表头都不显示 哪位大佬能帮帮我
- 如何实现在一个java的应用程序里复制一个Frame窗口中任意一个Container里的屏幕图象到一个JPanel上?
- jsp开发下有类似MS下的DataGrid控件吗?
谢谢了
http://www.javatoolsoft.com/javacellreport/JavaCellReport_2_4_12.exeMSN: [email protected]