This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Error: Connection got Reset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Error: Connection got Reset " Watch "Error: Connection got Reset " New topic
Author

Error: Connection got Reset

Vidu Greg
Greenhorn

Joined: Sep 05, 2005
Posts: 10
Hi

While writing Blob object in Oracle db, my connection is getting reset.

<<My Code-----
try {
PreparedStatement ps =null;
Connection conn = getConnection();
String sql = "INSERT INTO ATTACHMENT (ATTACHMENT.ID, DOC_DATA) "VALUES (?,?)";
ByteArrayInputStream inStream =
new ByteArrayInputStream(dto.getDoc_Data());
ps = conn.prepareStatement(sql);
ps.setInt(1,attachment_Id);
ps.setBinaryStream(4,inStream,inStream.available());
int rowsAdded = ps.executeUpdate();

} catch (SQLException e) {
e.printStackTrace();
}

>>>

I dont know why my my connection is getting reset so getting an error..i am trying to put a pdf file of size around 45kb...
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

The Oracle drivers have never been very good at handling LOBs. Are you using the latest driver?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
Consider Paul's rocket mass heater.
 
subject: Error: Connection got Reset
 
Similar Threads
java.sql.SQLException: You cannot set autocommit during a managed transaction!
help needed
Insert image into MySQL database
Inserting image to MySQL Database
java.sql.SQLException: You cannot set autocommit during a managed transaction!