Bipra De

Greenhorn
+ Follow
since Nov 06, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bipra De

Hi,

Is there any API or something which insert the data in chunks in db2 ?? I know inserting big size blob can cause performance issue but here i just need to get the value from the web service from remote application and insert in my database.

Thanks...
9 years ago
Hi,

Regarding the file transfer i think that can be very well accomplish by using FTP and that will not take much time also. And it's almost taking 20-25 min to insert the file in the database using hibernate when the file is on my local system and database on different server.
9 years ago
Hi,
I am using hibernate and trying to insert a file of size 200mb in the db2 database(column type as Blob). The corresponding java attribute is of type byte[]. Things work fine with small files and with big files it takes too much of time for insert. I have to read the file from a remote server and then insert. Can anyone please help me what will be the good practice to do this. document has to be saved in database as its client requirement.
Thanks.
9 years ago
Hi,

I am using WAS7 server and getting the following error.
com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: ResultSet is closed.

here is my code.

private byte[] extractDocxDoc(String stdNumber) {
byte[] buf=null;
DatabaseAccessObject dao=null;
try {
dao = new DatabaseAccessObject(ApplicationManager.getConnectionConfig());
} catch (TCCException e1) {
// TODO Auto-generated catch block
LogManager.err("EXCEPTION--"+ e1.toString());
}
Blob blob =null;
InputStream iStream =null;
Statement stmnt=null;
ResultSet resultSet=null;
Connection con =null;
String query=AdressSQL.SQL_BLOB_ADRESS + stdNumber+ AdressSQL.WITH_UR;
try
{
con=dao.getConnection();
stmnt=con.createStatement();

resultSet = stmnt.executeQuery(query);
while(resultSet.next())
{
blob = resultSet.getBlob(AdressSQL.STD_BLOB_WPD);
iStream=blob.getBinaryStream();
String dataToIndex=extractText(iStream);
buf = dataToIndex.getBytes();
//buf= blob.getBytes(1,(int)blob.length());
}

}
catch(SQLException sql)
{
System.out.println("HERE IS THE PROBLEM--"+ sql.toString());
System.out.println("HERE IS THE PROBLEM123--"+ sql.getMessage());
LogManager.err("SQLException--"+ sql.toString());
}
catch(TCCException e)
{
LogManager.err("TCCException--"+ e.toString());
}
// amar change ends for SeRV00540613

finally
{
try {
resultSet.close();
stmnt.close();
con.close();
blob=null;
} catch (SQLException e) {
// TODO Auto-generated catch block
LogManager.err("EXCEPTION--"+ e.toString());
}
}
return buf;
}

Please let me know if i am wrong at any place. Any help will be appreciated.
9 years ago

shailesh thakur wrote:Hi,
I am also preparaing for the SCWCD exam.Is Head First Servlets And JSP sufficient for preparation.
Do you have any practice questions.If yes ,please meail it to me on shailesh151@gmail.com



Hello Shailesh,

Head First Servlets And JSP is sufficent to clear the exam.Also go through java ranch forum .
Following links may be useful.
http://www.certification4career.com/
http://www.certgear.com/products/preview/scwcd/index.html
http://www.javacertificationexams.com/view.php?book=java.boot.by/wcd-guide/&t=SCWCD+1.4+Study+Guide+by+Mikalai+Zaikin
http://www.javaranch.com/carl/scwcd/scwcd_mock_logo.jsp
http://www.javacertificationexams.com/scwcd-mock-exams.php


All The Best!!!
Any website where once can get problem statements to build projects on servlets and JSPs?

I want to improve my skills by implementing my theoritical knowledge to code.
9 years ago
Thanks To Head First Servlets and JSP and to all Ranchers...Now I am SCWCD 1.5 certified .
Kindly suggest me the next certification in this path that will be useful.
Hello Frits,

Thanks for your response.beerv1 is the context root of my application and there is no directory with beerv1 under beerv1(i.e context root of my app). In my web.xm , whenl I am giving
<url-pattern>/*</url-pattern> then the browser asks for user name and password when trying to access form.html(localhost:8080/beerv1/form.html) but when I am giving <url-pattern>/beerv1/*</url-pattern> it does not prompts for user name and password. the page form.html is directly inside the context root i.e beerv1. What is causing this?

Regards,
Bipra De.
This is my web.xml DD


<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app>

<servlet>
<servlet-name>Ch3 Beer</servlet-name>
<servlet-class>com.example.web.BeerSelect</servlet-class>
</servlet>
<security-role><role-name>admin</role-name></security-role>

<servlet-mapping>
<servlet-name>Ch3 Beer</servlet-name>
<url-pattern>/SelectBeer.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>form.html</welcome-file>
</welcome-file-list>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<securtiy-constraint>
<web-resource-collection>
<url-pattern>/beerv1/*</url-pattern>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
<user-data-constraint>
<transport-gurantee>CONFIDENTIAL</transport-gurantee>
</user-data-constraint>
</securtiy-constraint>
</web-app>

This is my tomcat-users.xml file

<?xml version="1.0" encoding="utf-8" ?>
- <tomcat-users>
<role rolename="manager" />
<role rolename="admin" />
<user username="admin" password="" roles="admin,manager" />
</tomcat-users>



Instead of asking for login when trying to access "localhost:8080/beerv1/form.html" , it is allowing me to access it without asking for user id and password. What is the problem?
Thanks in advance.
This is my web.xml DD


<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app>

<servlet>
<servlet-name>Ch3 Beer</servlet-name>
<servlet-class>com.example.web.BeerSelect</servlet-class>
</servlet>
<security-role><role-name>admin</role-name></security-role>

<servlet-mapping>
<servlet-name>Ch3 Beer</servlet-name>
<url-pattern>/SelectBeer.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>form.html</welcome-file>
</welcome-file-list>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<securtiy-constraint>
<web-resource-collection>
<url-pattern>/beerv1/*</url-pattern>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
<user-data-constraint>
<transport-gurantee>CONFIDENTIAL</transport-gurantee>
</user-data-constraint>
</securtiy-constraint>
</web-app>

This is my tomcat-users.xml file

<?xml version="1.0" encoding="utf-8" ?>
- <tomcat-users>
<role rolename="manager" />
<role rolename="admin" />
<user username="admin" password="" roles="admin,manager" />
</tomcat-users>



Instead of asking for login when tryying to access "localhost:8080/beerv1/form.html" , it is allowing me to access it. What is the problem?
Thanks in advance.
9 years ago
I am getting the following error after selecting a beer color in the form.html

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Class com.example.web.BeerSelect is not a Servlet
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Unknown Source)
root cause

java.lang.ClassCastException: com.example.web.BeerSelect cannot be cast to javax.servlet.Servlet
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Unknown Source)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.



I am using Tomcat6.0 and have deployed the files according to that mentioned in the book.Alos I have changed the <web-app> in the web.xml to
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">


Please help.Do I have to put any javax.servlet jar file in any folder in Tomcat?

Thanks in Advance.
I want to take certain no inputs from the user and I want the output"Enter ...." asking user to enter certain values to get cleared after the user has entered the value asked
10 years ago

Hello All,

I want to code and practice for the SCJP exam by doing some mini project.Kindly suggest me some URLs where I can find problem statements that can be coded using core JAVA.

Thanks in Advance.

Regards,
Bipra De.