public Company getCompanyByName(String companyName) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException{
		ResultSet rs = null;
		Connection cn = null;
		cn = ConnectionFactory.open();
		PreparedStatement stmt = null;
		Company company = new Company();

		cn = ConnectionFactory.open();
		try{	
		stmt = cn.prepareStatement("SELECT * FROM company where name=?;");
			stmt.setString(1, companyName);
			rs= stmt.executeQuery();
				while (rs.next()) {
				
					company.setId(rs.getInt(1));
					company.setName(rs.getString(2));
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
		stmt.close();
			return company;
		
	}