小编Aki*_*aje的帖子

将数据从Java导出到MS Excel的最佳方法

我正在网上搜索从我的Java桌面应用程序导出数据到Excel的答案,我遇到了Apache POI API.然后我发现JDBC可以工作,然后我偶然发现了JExcel.它们都同样好,还是我应该专注于其中最好的,哪个是它?

干杯.

java excel

12
推荐指数
2
解决办法
8万
查看次数

JavaMail - 发件人地址被拒绝:访问被拒绝

好吧,我不知道还能做什么。一周前,当我编写和测试它时,这段代码运行得非常好。然后我将它嵌入到我的程序中并意识到我不断收到异常。一切似乎都很正常。发件人地址合法。我用来测试它的收件人地址是合法的。怎么了?我很沮丧:

private String outgoingMailServer = "smtp.mail.yahoo.com";

boolean debug = true;

            //set the host outgoing mail smtp server.
            Properties properties = new Properties();
            properties.put("mail.smtp.host", outgoingMailServer);
            properties.put("mail.smtp.auth", "true");

            Authenticator authenticator = new SMTPAuthentication();
            Session session = Session.getDefaultInstance(properties, authenticator);

            session.setDebug(debug);

            //create a message session
            Message msg = new MimeMessage(session);

            //set the addresses, to and from
            InternetAddress fromAddress;
            fromAddress = new InternetAddress(emailFromAddress);
            msg.setFrom(fromAddress);

            //since mail can be sent to more than one recipient, create loop
            //to add all addresses into InternetAddress, addressTo.
            //InternetAddress[] toAddress …
Run Code Online (Sandbox Code Playgroud)

java jakarta-mail yahoo-mail

4
推荐指数
1
解决办法
3万
查看次数

标签 统计

java ×2

excel ×1

jakarta-mail ×1

yahoo-mail ×1