import java.sql.*;
public class EmployeePrepStat
{
	public static void main(String args[])
 	 { 
		PreparedStatement st;
		Connection con;
		try{
			System.out.println("正在连接数据库...");
			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
		   }
		catch(ClassNotFoundException e){} ;
		try{
			con=DriverManager.getConnection("jdbc:odbc:aaa","",""); 
			System.out.println("already connected.");
			st=con.prepareStatement("insert into jobs(job_desc) values (?)");
		
			st.setString(1,"Adam");	
			
    			st.executeUpdate();
                        System.out.println("行已添加");
			st.close();
			
       			con.close(); 
    		 }
   		catch(Exception e1) 
		{System.out.println("异常"+e1);}
 	} 
}

