selectdb.java

来自「JAVA编写的单击的PIZZA店销售系统」· Java 代码 · 共 36 行

JAVA
36
字号
package Dbprocess;
import java.sql.*;
public class SelectDB {
	Connection con;
	ResultSet resultSet;
	/**
	 * Select * from atable
	 */
	public SelectDB(String atable){
		try{
			String sql = "Select * from ?";
			PreparedStatement pstate = con.prepareStatement(sql);
			pstate.setString(1,atable);
			resultSet = pstate.executeQuery();	
		}
		catch (Exception e) {
	        e.printStackTrace();
	    }
	}
	/**
	 * Select 
	 *
	 */
	public SelectDB(){
		
	}
	public Connection getCon() {
		return con;
	}
	public ResultSet getResultSet() {
		return resultSet;
	}
	
	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?