昨天晚上,我离开了办公室,运行了一个由我编写的Java程序.它应该使用JDBC连接将大量记录插入到我们的公司数据库(Oracle)中.今天早上当我回来工作时,我看到了这个错误(由try-catch捕获):
java.sql.SQLRecoverableException: I/O Exception: Connection reset
Run Code Online (Sandbox Code Playgroud)
在得到这个问题之前,该程序几乎写了所有记录,但如果它发生得很早(我晚上离开办公室几分钟后)怎么办?我无法理解发生了什么,我联系了我的数据库管理员,他说数据库没有特别的问题.
关于发生了什么以及我可以做些什么来避免它的任何想法?
我知道这个问题可能看起来很愚蠢,因为我不能给它很多关于它的信息,但我认为这个问题必须是某种bug ...
我编写了一个带有NetBeans 7.1的java程序,现在尝试运行时会出现此错误.10分钟前它完全正常运行,我没有改变错误所指的类
这可能是某种NetBeans错误吗?也许这是一个众所周知的问题?
正如标题所示,我想用我的 gmail 帐户发送电子邮件,编写一些 java 代码。我找到了很多代码示例,但没有一个对我有用
我正在寻找这个:How can I send an email by Java application using GMail, Yahoo, or Hotmail?
我已经尝试过作为答案发布的代码,但我得到了这个异常:
javax.mail.MessagingException: Can't send command to SMTP host;
nested exception is:
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1717)
at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1704)
at com.sun.mail.smtp.SMTPTransport.ehlo(SMTPTransport.java:1088)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:468)
at javax.mail.Service.connect(Service.java:291)
at javax.mail.Service.connect(Service.java:172)
...
Run Code Online (Sandbox Code Playgroud)
代码是这样的:
public class GmailTest {
private static String USER_NAME = "*****"; // GMail user name (just the part before "@gmail.com")
private static String PASSWORD …Run Code Online (Sandbox Code Playgroud) 我想在图表的 X 轴上显示一些日期,这里据说我必须使用 TimeSeriesCollections 对象
似乎我必须向 TimeSeriesCollections 添加一个 TimeSeries,并且必须使用 RegularTimePeriod 构建 TimeSeries ......我有点困惑......
你能解释一下我必须做什么吗?如果可能的话,你能提供一些示例代码吗?谢谢
我正在使用 javax.mail 发送一些电子邮件。它工作正常,只是它不会将消息发送到 CC/BCC
message.setRecipient(Message.RecipientType.TO, new InternetAddress("a@x.com"));
message.setRecipient(Message.RecipientType.CC, new InternetAddress("b@x.com"));
Run Code Online (Sandbox Code Playgroud)
a@x.com 正确收到消息(其中还标明了抄送地址),但 b@x.com 没有收到
这里是完整的代码:
// Get system properties
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", "192.168.1.1");
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.auth", "true");
// Crea un authenticator (per mandare mail anche all'esterno del dominio)
Authenticator authenticator = new Interfaccia_CSR.SMTPAuthenticator();
// Get session
Session session = Session.getInstance(props, authenticator);
// Define message
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress("sender@x.com"));
message.setRecipient(Message.RecipientType.TO, new InternetAddress("a@x.com"));
message.setRecipient(Message.RecipientType.CC, new InternetAddress("b@x.com"));
message.setSubject(oggetto);
// create the message part
MimeBodyPart …Run Code Online (Sandbox Code Playgroud) java ×5
gmail ×1
ioexception ×1
jakarta-mail ×1
jfreechart ×1
netbeans-7 ×1
oracle ×1
time-series ×1