📄 contractgetsql.java
字号:
package com.zh.util;
import java.sql.*;
import java.io.*;
import com.zh.conpool.*;
public class contractgetsql{
String sql;
String id;
String text1;
String text2;
String text3;
String text4;
String text5;
String text6;
String text7;
String text8;
Condata con=new Condata();
public void setText1(String newtext1){
this.text1=newtext1;
}
public String getText1(){
return text1;
}
public void setText2(String newtext2){
this.text2=newtext2;
}
public String getText2(){
return text2;
}
public void setText3(String newtext3){
this.text3=newtext3;
}
public String getText3(){
return text3;
}
public void setText4(String newtext4){
this.text4=newtext4;
}
public String getText4(){
return text4;
}
public void setText5(String newtext5){
this.text5=newtext5;
}
public String getText5(){
return text5;
}
public void setText6(String newtext6){
this.text6=newtext6;
}
public String getText6(){
return text6;
}
public void setText7(String newtext7){
this.text7=newtext7;
}
public String getText7(){
return text7;
}
public void setText8(String newtext8){
this.text8=newtext8;
}
public String getText8(){
return text8;
}
public void RsSql(String id){
this.id=id;
sql="select * from tb_contract where Id='"+id+"'";
ResultSet rs=null;
try{
con.getConnection();
}catch(Exception e){
e.getMessage();
}
try{
rs=con.executeQuery(sql);
if(rs.next()){
this.setText1(rs.getString(2));
this.setText2(rs.getString(3));
this.setText3(rs.getString(4));
this.setText4(rs.getString(5));
this.setText5(rs.getString(6));
this.setText6(rs.getString(7).substring(0,10));
this.setText7(rs.getString(8).substring(0,10));
this.setText8(rs.getString(9));
}
}catch(Exception e){
e.getMessage();
}
try{
con.close();
con=null;
}catch(Exception ex){
ex.getMessage();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -