未找到异常类

时间:2016-07-20 07:07:29

标签: java

我正在尝试编译program UCanAccess.java。我运行时遇到以下异常。 "java.lang.ClassNotFoundException: net.ucanaccess.jdbc.UcanaccessDriver"

我已将所有UcanAccess jar文件复制到我的java代码所在的文件夹中。已经DSN。任何人都可以告诉我为什么我收到这条消息。

import java.sql.DriverManager;    
import java.sql.ResultSet;    
import java.sql.Statement;    
import java.sql.SQLException;    
import java.sql.*;     

public class UCanAccessExample {
  public static void main(String args[]){
    try {
      String url = "jdbc:ucanaccess://c:/UCanAccess/Personinfo.accdb";
      Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
      Connection con = DriverManager.getConnection(url);
      Statement st = con.createStatement();
      String sql = "SELECT * FROM Person";
      ResultSet rs = st.executeQuery(sql);

      while(rs.next()){
        String name = rs.getString("name");
        String add = rs.getString("address");
        String phone = rs.getString("phoneNum");
        System.out.println(name + "  " + add + "  " + phone);
      }
      con.close();
    } catch(Exception sqlEx){
      System.out.println(sqlEx);
    }
  }
}

Image of folder in which my files are

1 个答案:

答案 0 :(得分:0)

您需要在class-path中添加$scope.get_all_places = function () { $http.get("get-all-places").then(function (response) { $scope.selected_place = eval(response.data[0]); var $shape_options = selected_place.shape_attributes; var $map_options = selected_place.map_attributes; switch ($shape_options.shape_type) { case 'circle': var $center = selected_place.center; var $radius = selected_place.radius; break; case 'rectangle': var $bounds = selected_place.rectangle; break; case 'polygon': var $path = selected_place.polygon; break; }); other_functions($map_options);//call the functions that need the $map_options variable }; 驱动程序。

Here是做到这一点的方法。

UCanAccess