错误: 无法访问Referenceable 找不到javax.naming.Referenceable的类文件

Android 码拜 9年前 (2015-05-11) 3205次浏览 0个评论
    public static void connectionDB(){
        Connection con = null;
        CallableStatement cstmt = null;
        ResultSet rs = null;

        try {
            // Establish the connection.
            SQLServerDataSource ds = new SQLServerDataSource();
            ds.setIntegratedSecurity(false);
            ds.setUser("comup");
            ds.setPassword("1024");
            ds.setServerName("172.19.149.250");
            ds.setPortNumber(1433);
            ds.setDatabaseName("Tetris");
            con = ds.getConnection();

            // Execute a stored procedure that returns some data.
            cstmt = con.prepareCall("{call dbo.uspGetEmployeeManagers(?)}");
            cstmt.setInt(1, 50);
            rs = cstmt.executeQuery();

            // Iterate through the data in the result set and display it.
            while (rs.next()) {
                System.out.println("EMPLOYEE: " + rs.getString("LastName") +
                        ", " + rs.getString("FirstName"));
                System.out.println("MANAGER: " + rs.getString("ManagerLastName") +
                        ", " + rs.getString("ManagerFirstName"));
                System.out.println();
            }
        }

        // Handle any errors that may have occurred.
        catch (Exception e) {
            e.printStackTrace();
        }

        finally {
            if (rs != null) try { rs.close(); } catch(Exception e) {}
            if (cstmt != null) try { cstmt.close(); } catch(Exception e) {}
            if (con != null) try { con.close(); } catch(Exception e) {}
        }
    }

用的android studio

错误: 无法访问Referenceable 找不到javax.naming.Referenceable的类文件

10分
大兄弟这个是Java的吧,你应该去Java论坛发会好点
10分
这个是java方面的东西

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明错误: 无法访问Referenceable 找不到javax.naming.Referenceable的类文件
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!