storedb.java

来自「用java编写的c/s结构的网络社区」· Java 代码 · 共 37 行

JAVA
37
字号
package client;
import java.sql.*;




public class Storedb extends database
{
	Storedb(String strDBName, String id, String pw)
	{
		super(strDBName, id, pw);
	}
	void QueryData(String strName)
	{
		String strQuery="Select * from 商品 WHERE 商品名称='"+strName+"'";
		try {
			rs=sql.executeQuery(strQuery);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	boolean next() throws SQLException
	{
		return rs.next();
	}
	int getInt(String columnName) throws SQLException
	{
		return rs.getInt(columnName);
	}
	void updatedata(String columnName,Object x) throws SQLException
	{
		    rs.absolute(1);   
			rs.updateObject(columnName,x);
			rs.updateRow();
		
	}
}

⌨️ 快捷键说明

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