第一篇:簡單的員工信息查詢java程序
import java.awt.event.ActionListener;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.sql.*;
public class Employee extends JFrame implements ActionListener{
String titles[]={“工號:”,“姓名:”,“性別:”,“出生日期:”,“聯系電話:”,“家庭住址:”,“個人情況:”};
JTextField employeeID=new JTextField(8);
JTextField employeeName=new JTextField(8);
JTextField employeeSex=new JTextField(2);
JTextField employeeBirthday=new JTextField(6);
JTextField employeePhone=new JTextField(11);
JTextField employeeAddress=new JTextField(20);
JTextArea employeeResume=new JTextArea();
JButton first=new JButton(“首頁”);
JButton next=new JButton(“下一條”);
JButton previous=new JButton(“上一條”);
JButton last=new JButton(“尾頁”);
Statement stmt;
ResultSet rs;
Employee(){
super(“員工信息查詢”);
setSize(350,330);
try{
Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);
Connection conn=DriverManager.getConnection(“jdbc:odbc:mydb”,“sa”,“123”);
stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
rs=stmt.executeQuery(“select * from mdb”);
getContentPane().setLayout(new BorderLayout(0,8));
JPanel p[]=new JPanel[6];
for(int i=0;i<6;i++){
p[i]=new JPanel(new FlowLayout(FlowLayout.LEFT,10,0));
p[i].add(new JLabel(titles[i]));
}
p[0].add(employeeID);
p[1].add(employeeName);
p[2].add(employeeSex);
p[3].add(employeeBirthday);
p[4].add(employeePhone);
p[5].add(employeeAddress);
JPanel p1=new JPanel(new GridLayout(6,1,0,8));
JScrollPane jsp=new JScrollPane(employeeResume,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
jsp.setPreferredSize(new Dimension(250,80));
for(int i=0;i<6;i++)
p1.add(p[i]);
JPanel p2=new JPanel(new FlowLayout(FlowLayout.LEFT,10,0));
p2.add(new JLabel(titles[6]));
p2.add(jsp);
JPanel p3=new JPanel();
p3.add(first);
p3.add(previous);
p3.add(next);
p3.add(last);
getContentPane().add(p1,“North”);
getContentPane().add(p2,“Center”);
getContentPane().add(p3,“South”);
next.addActionListener(this);
previous.addActionListener(this);
first.addActionListener(this);
last.addActionListener(this);
rs.first();
display();
}catch(Exception e){e.printStackTrace();}
setVisible(true);
}
public void actionPerformed(ActionEvent e){
try{
if(e.getSource()==next)rs.next();
else if(e.getSource()==previous)rs.previous();
else if(e.getSource()==first)rs.first();
else if(e.getSource()==last)rs.last();
display();
}catch(Exception ee){ee.printStackTrace();}
}
boolean display(){
try{
employeeID.setText(rs.getString(“employeeID”));
employeeName.setText(rs.getString(“employeeName”));
employeeSex.setText(rs.getString(“employeeSex”));
employeeBirthday.setText(rs.getString(“employeeBirthday”));
employeePhone.setText(rs.getString(“employeePhone”));
employeeAddress.setText(rs.getString(“employeeAddress”));
}employeeResume.setText(rs.getString(“employeeResume”));}catch(SQLException e){e.printStackTrace();return false;}return true;}public static void main(String[] args){JFrame.setDefaultLookAndFeelDecorated(true);Employee em=new Employee();}
第二篇:java實現二代身份證信息查詢程序
本文是在java平臺上編寫的二代身份證信息查詢程序,可以查詢二代身份證的基本信息,包括文字信息和圖像信息。用到的Jar包是JNative.jar,這個很容易就能下載到,下載后添加到工程的外部jar庫中。另外,程序裝載了sdtapi.DLL和WltRS.DLL文件,這兩個文件必須放到C:WindowsSystem32目錄下。只有一個java文件,需要說明的是:用到的測試設備接口是RS232串口,USB的接口程序可自行修改。資料是在網上用積分買的,現免費共享給手上沒有積分的朋友下載。
package com.a;
import javax.swing.*;import org.xvolks.jnative.JNative;import org.xvolks.jnative.Type;import org.xvolks.jnative.exceptions.NativeException;import org.xvolks.jnative.pointers.Pointer;import org.xvolks.jnative.pointers.memory.MemoryBlockFactory;import java.awt.*;import javax.imageio.ImageIO;import java.io.*;import java.util.StringTokenizer;import java.awt.event.*;
public class IdentityInfoReader extends JFrame implements ActionListener { private static final long serialVersionUID =-***8441L;JLabel[] label = new JLabel[10];JButton showBmp;JTextField[] text = new JTextField[9];String[] labelItem = {“姓名:”, “性別:”, “民族:”, “出生年月:”, “地址:”, “身份證號:”, “簽發機構:”, “期限起始:”, “期限終止:”};JNative openJN = null, findJN = null, selectJN = null, readJN = null, MngJN = null, BmpJN = null, closeJN = null;JButton readJB, exitJB;int iPort = 1;int iIfOpen = 1;
public InformationReader(String str){
super(str);
System.loadLibrary(“sdtapi”);
try {
try {
init();
} catch(NativeException e){
} catch(UnsupportedEncodingException e){
e.printStackTrace();
}
} catch(IllegalAccessException e){
}
label[0] = new JLabel(“二代身份證信息”);
label[0].setBounds(200, 20, 95, 25);
getContentPane().add(label[0]);
for(int j = 1;j < labelItem.length + 1;j++){
label[j] = new JLabel(labelItem[j1]);} text[0].setText(Info[0]);if(Info[1].charAt(0)== '1'){ text[1].setText(“男”);} else if(Info[1].charAt(0)== '2')text[1].setText(“女”);char[] nationChar = new char[2];Info[1].getChars(1, 3, nationChar, 0);String nationStr = “";nationStr = String.valueOf(nationChar);if(nationStr.equals(”01“))text[2].setText(”漢“);else if(nationStr.equals(”02“))text[2].setText(”蒙古族“);else if(nationStr.equals(”03“))text[2].setText(”回族“);else if(nationStr.equals(”04“))text[2].setText(”藏族“);else if(nationStr.equals(”05“))text[2].setText(”維吾爾族“);else if(nationStr.equals(”06“))text[2].setText(”苗族“);else if(nationStr.equals(”07“))text[2].setText(”彝族“);else if(nationStr.equals(”08“))text[2].setText(”壯族“);else if(nationStr.equals(”09“))text[2].setText(”布依族“);else if(nationStr.equals(”10“))text[2].setText(”朝鮮族“);else if(nationStr.equals(”11“))text[2].setText(”滿族“);else if(nationStr.equals(”12“))text[2].setText(”侗族“);else if(nationStr.equals(”13“))text[2].setText(”瑤族“);else if(nationStr.equals(”14“))text[2].setText(”白族“);else if(nationStr.equals(”15“))text[2].setText(”土家族“);else if(nationStr.equals(”16“))text[2].setText(”哈尼族“);else if(nationStr.equals(”17“))text[2].setText(”哈薩克族“);else if(nationStr.equals(”18“))text[2].setText(”傣族“);else if(nationStr.equals(”19“))text[2].setText(”黎族“);
else if(nationStr.equals(”20“))text[2].setText(”傈僳族“);else if(nationStr.equals(”21“))text[2].setText(”佤族“);else if(nationStr.equals(”22“))text[2].setText(”畬族“);else if(nationStr.equals(”23“))text[2].setText(”高山族“);else if(nationStr.equals(”24“))text[2].setText(”拉祜族“);else if(nationStr.equals(”25“))text[2].setText(”水族“);else if(nationStr.equals(”26“))text[2].setText(”東鄉族“);else if(nationStr.equals(”27“))text[2].setText(”納西族“);else if(nationStr.equals(”28“))text[2].setText(”景頗族“);else if(nationStr.equals(”29“))text[2].setText(”柯爾克孜族“);else if(nationStr.equals(”30“))text[2].setText(”土族“);else if(nationStr.equals(”31“))text[2].setText(”達翰爾族“);else if(nationStr.equals(”32“))text[2].setText(”仫佬族“);else if(nationStr.equals(”33“))text[2].setText(”羌族“);else if(nationStr.equals(”34“))text[2].setText(”布朗族“);else if(nationStr.equals(”35“))text[2].setText(”撒拉族“);else if(nationStr.equals(”36“))text[2].setText(”毛南族“);else if(nationStr.equals(”37“))text[2].setText(”仡佬族“);else if(nationStr.equals(”38“))text[2].setText(”錫伯族“);else if(nationStr.equals(”39“))text[2].setText(”阿昌族“);else if(nationStr.equals(”40“))text[2].setText(”普米族“);else if(nationStr.equals(”41“))text[2].setText(”哈薩克族“);else if(nationStr.equals(”42“))text[2].setText(”怒族“);else if(nationStr.equals(”43“))text[2].setText(”烏孜別克族“);else if(nationStr.equals(”44“))text[2].setText(”俄羅斯族“);else if(nationStr.equals(”45“))text[2].setText(”鄂溫克族“);else if(nationStr.equals(”46“))
text[2].setText(”德昂族“);
else if(nationStr.equals(”47“))
text[2].setText(”保安族“);
else if(nationStr.equals(”48“))
text[2].setText(”裕固族“);
else if(nationStr.equals(”49“))
text[2].setText(”京族“);
else if(nationStr.equals(”50“))
text[2].setText(”塔塔爾族“);
else if(nationStr.equals(”51“))
text[2].setText(”獨龍族“);
else if(nationStr.equals(”52“))
text[2].setText(”鄂倫春族“);
else if(nationStr.equals(”53“))
text[2].setText(”赫哲族“);
else if(nationStr.equals(”54“))
text[2].setText(”門巴族“);
else if(nationStr.equals(”55“))
text[2].setText(”珞巴族“);
else if(nationStr.equals(”56“))
text[2].setText(”基諾族“);
else if(nationStr.equals(”57“))
text[2].setText(”其它“);
else if(nationStr.equals(”98“))
text[2].setText(”外國人入籍“);
String BirthyearStr = ”“;
char[] BirthyearChar = new char[4];
Info[1].getChars(3, 7, BirthyearChar, 0);
BirthyearStr = String.valueOf(BirthyearChar);
String BirthmonthStr = ”“;
char[] BirthmonthChar = new char[2];
Info[1].getChars(7, 9, BirthmonthChar, 0);
BirthmonthStr = String.valueOf(BirthmonthChar);
String BirthdateStr = ”“;
char[] BirthdateChar = new char[2];
Info[1].getChars(9, 11, BirthdateChar, 0);
BirthdateStr = String.valueOf(BirthdateChar);
text[3].setText(BirthyearStr + ”年“ + BirthmonthStr + ”月“ + BirthdateStr + ”日“);
char[] addressChar = new char[Info[1].length()18];
Info[2].getChars(18, Info[2].length(), issueChar, 0);
String issueStr = ”“;
issueStr = String.valueOf(issueChar);
text[6].setText(issueStr);
char[] startyearChar = new char[4];
Info[3].getChars(0, 4, startyearChar, 0);
String startyearStr = ”“;
startyearStr = String.valueOf(startyearChar);
char[] startmonthChar = new char[2];
Info[3].getChars(4, 6, startmonthChar, 0);
String startmonthStr = ”“;
startmonthStr = String.valueOf(startmonthChar);
char[] startdateChar = new char[2];
Info[3].getChars(6, 8, startdateChar, 0);
String startdateStr = ”“;
startdateStr = String.valueOf(startdateChar);
text[7].setText(startyearStr + ”年“ + startmonthStr + ”月“ + startdateStr + ”日“);
char[] endyearChar = new char[4];
Info[3].getChars(8, 12, endyearChar, 0);
String endyearStr = ”“;
endyearStr = String.valueOf(endyearChar);
char[] endmonthChar = new char[2];
Info[3].getChars(12, 14, endmonthChar, 0);
String endmonthStr = ”“;
endmonthStr = String.valueOf(endmonthChar);
char[] enddateChar = new char[2];
Info[3].getChars(14, 16, enddateChar, 0);
String enddateStr = ”“;
enddateStr = String.valueOf(enddateChar);
text[8].setText(endyearStr + ”年“ + endmonthStr + ”月“ + enddateStr + ”日“);
int count1 = d.getSize();
byte[] byteArray1 = new byte[count1];
for(i = 0;i < count1;i++)
byteArray1[i] = c.getAsByte(i);
try {
File myFile = new File(”zp.wlt“);
FileOutputStream out = new FileOutputStream(myFile);
out.write(byteArray1, 0, count1-1);
} catch(IOException t){
}
closeJN.invoke();
// System.out.println(closeJN.getRetVal());
int l = 0;
System.loadLibrary(”WltRS“);
BmpJN = new JNative(”WltRS“, ”GetBmp“);
BmpJN.setRetVal(Type.INT);
BmpJN.setParameter(l++, ”zp.wlt“);
BmpJN.setParameter(l++, 1);
BmpJN.invoke();
if(readJN.getRetVal().equals(”144“))
System.out.println(”相片解碼成功!“);
else
System.out.println(”相片解碼不成功!“);
Image image = null;
try {
image = ImageIO.read(new File(”zp.bmp“));
} catch(IOException ex){
}
ImageIcon icon = new ImageIcon(image);
showBmp.setIcon(icon);
getContentPane().add(showBmp);
setVisible(true);
a.dispose();
b.dispose();
c.dispose();
d.dispose();
e.dispose();
} catch(NativeException e){
} catch(UnsupportedEncodingException e){
e.printStackTrace();
}
} catch(IllegalAccessException e){
} }
public static void main(String agrs[]){
InformationReader informationReader = new InformationReader(”二代身份證信息讀取");
informationReader.setSize(500, 500);} }
第三篇:關于JAVA一些問題 程序總結
關于JAVA一些問題 程序總結
public interface SinterFace { public final static String intstr=“hello is interface”;public abstract void nostat();}
public class Useinter implements SinterFace {
int inter = 5;static String str = “hello is class”;public double dou = 1.0;
public void nostat(){ System.out.println(“is no static method”);}
public static void stat(){ System.out.println(“is static method”);} }
public class Main {
public static void main(String[] args){
System.out.println(“靜態變量方法在類實例化之前都可以調用:”);Useinter.stat();System.out.println(Useinter.str +“n”);
System.out.println(“非靜態變量方法要在類實例化之后才可以調用:”);Useinter useinter = new Useinter();useinter.nostat();System.out.println(useinter.dou);System.out.println(“類中沒聲明是private的變量默認都是public”);System.out.println(useinter.inter);
System.out.println(“n類里的靜態變量可以被實例調用:”);System.out.println(useinter.str +“n”);
System.out.println(“接口里的靜態變量可以直接被調用:”);System.out.println(SinterFace.intstr);} }
第四篇:信息查詢 申請書(鎮)
信息查詢申請書
申請人:河南省濮陽縣柳屯鎮周村12戶村民。
代表人:周慶雪,男,漢族,1954年9月7日出生,住河南省濮陽縣柳屯鎮周村001號。電話:*** 代表人:王連海,男,漢族,1955年2月11日出生,住河南省濮陽縣柳屯鎮周村141號。電話:*** 被申請人:濮陽縣柳屯鎮人民政府 住所地:濮陽縣柳屯鎮柳屯村 法定代表人:周和平支書 申請事項:
1、請求被申請人濮陽縣柳屯鎮人民政府對濮陽縣黃河東路的道路規劃的基本情況向社會作出信息公開。
2、請求被申請人濮陽縣柳屯鎮人民政府重新更換評估機構,重新對申請人的房屋按照現行市場價格公平、公正作出評估。事實與理由:
一、申請人河南省濮陽縣柳屯鎮周村12戶村民的基本情況 申請人河南省濮陽縣柳屯鎮周村12戶村民在河南省濮陽縣柳屯鎮周村居住,申請人王連海等七戶村民自2000年以來按濮陽縣的村鎮規劃,依法在濮陽縣柳屯鎮周村蓋了三層樓房,村民王國強2000年蓋了三層樓房其他五戶村民蓋了兩層樓房,申請人和其他六戶村民在新蓋樓房內居住至今。申請人周慶雪等五戶村民自1986年在河南省濮陽縣柳屯鎮周村居住至今,2010年申請人周慶雪蓋了三層樓房,其他四戶村民2010年在原住所上蓋了兩層新樓房。
二、被申請人對申請人的房屋實施拆遷評估價值過低 2013年7月19日河南省濮陽縣柳屯鎮周村支部書記周和平1 向申請人送達了豫盛華評報字(2013)第038-034號《拆遷房屋分戶評估報告》,申請人認為豫盛華評報字(2013)第038-034號《拆遷房屋分戶評估報告》不符合客觀實際,對申請人河南省濮陽縣柳屯鎮周村12戶村民房屋評估過低,嚴重侵害了申請人河南省濮陽縣柳屯鎮周村12戶村民的合法權利,申請人強烈要求被申請人濮陽縣柳屯鎮人民政府重新更換評估機構,客觀、公正的對申請人的房屋進行評估。
三、申請人依法請求被申請人濮陽縣柳屯鎮人民政府向社會公開濮陽縣黃河東路的道路規劃的基本信息
申請人根據《中華人民共和國政府信息公開條例》第九條:“行政機關對符合下列基本要求之一的政府信息應當主動公開:
(一)涉及公民、法人或其他組織切身利益的;
(四)其他依照法律、法規和國家有關規定應當主動公開的”第十條:“縣級以上各級人民政府及其部門應當依照本條例第九條規定,在各自職責范圍內確定主動公開的政府信息的具體內容,并重點公開下列政府信息:
(二)國民經濟和社會發展規劃、專項規劃、區域規劃及相關政策;
(八)重大建設項目的批準和實施情況;”的規定,要求被申請人濮陽縣柳屯鎮周村村委會對濮陽市黃河東路向東拓展的政府信息向社會公開,因該項規劃涉及申請人濮陽縣柳屯鎮周村12戶村民12戶村民切身利益,申請人濮陽縣柳屯鎮周村12戶村民請求被申請人依法辦事,讓申請人了解涉及自己切身利益的房屋拆遷信息、拆遷房屋的補償情況。
申請人濮陽縣柳屯鎮周村12戶村民現在居住的房屋是申請人唯一的住處,申請人為了維護自己的合法權利,根據《中華人民共和國政府信息公開條例》第十三條:“除本條例第九條、第十條、第十二條規定的行政機關主動公開的政府信息 2
外,公民、法人或者其他組織還可以根據自身生產、生活、科研等特殊需要,向國務院部門、地方各級人民政府及縣級以上地方人民政府部門申請獲取相關政府信息。”請求被申請人濮陽縣柳屯鎮人民政府依法公開濮陽縣黃河東路的道路規劃的基本信息,被申請人濮陽縣柳屯鎮人民政府重新更換評估機構,重新對申請人的房屋按照現行市場價格公平、公正作出評估為盼!!
此致
濮陽縣柳屯鎮人民政府
申請人:河南省濮陽縣柳屯鎮周12戶村民
第五篇:住房信息查詢授權委托書
住房信息查詢授權委托書
委托人:________(身份證號碼:__________________________)受托人:________(身份證號碼:__________________________)
人因辦理(銀行貸款□、契稅優惠□、減免個人所得稅□)的需要,茲委托_______同志代為辦理住房信息證明,由此產生的一切法律責任均由本人自行承擔。
委托人:
受托人:
日期: