连接数据库java

来源:百度知道 编辑:UC知道 时间:2024/04/29 00:18:05
package query
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class QueryFrame extends JFrame implements ActionListener{
JTextField jf = new JTextField(20);
String[] value = {"姓名","部门"};
JComboBox box = new JComboBox(value);
JButton find = new JButton("查询");
JPanel panel_find = new JPanel();
JPanel panel_content = new JPanel();
Statement stmt = null;

public QueryFrame() {
this.setTitle("查询系统");
Container c = this.getContent

<%
If (Trim(Request.Form("InputScore")) <> "" and Trim(Request.Form("StudentNum")) <> "") Then
MM_editConnection = MM_StudentConn_STRING
MM_editTable = Request("SheetName")
MM_editRedirectUrl = "scoreinput2.asp?" & session("strQureyString")
MM_editQuery=""
if Instr(Request.Form("StudentNum"),",")>0 then '需要对多条记录进行操作
arrStudentNum = Split(Replace(Request.Form("StudentNum")," ",""),",")
'arrEditType = Split(Replace(Request.Form("EditType")," ",""),",")
arrSubject = Split(Replace(Request.Form("Subject"),"|value",""),"|")
dim arrScore()
Redim arrScore(UBound(arrSubject)+1)
for intTemp = LBound(arrSubject) to UBound(arrSubject)
arrScore(intTemp)=Replace(Replace(Request.