ankur tyagi

Ranch Hand
+ Follow
since Apr 01, 2009
New Delhi ,India
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by ankur tyagi

i just saw some jsp tags and then used my knowledge of java and html
to create this page...
can you help me out on this one...
7 years ago
JSP
do you mean running directly sql command in oracle...??
yes they run just fine...
they are running with servlet as well but due to not closing of connections, it gives NPE
hi i am new to jsp
i am using a jsp to show some values in form of tables..
the values are taken from the servlet which forwards the request to the jsp..
what i want is to have different color of one table data on the basis of its value
here is the code of the jsp

i want the values of the table data mon, tue ,wed, thu....
to be either red or green depending on its value
the value will be either N or Y
7 years ago
JSP
i am using functions because i am using nested queries, so i would need to paste the code twice ..
even then i tried doing it with this code..

but the result was that i only get the first column from the table
and nothing else and this time i was able to refresh it as many times i want...
the initial problem was removed by making a system DSN.
the servlet is getting values ..and page is generated.
but there is a new sort of problem now..
when i start the database and the tomcat and load the page , the values are shown just fine but if i refresh the page 4-5 times
the servlet starts giving the same exception all over again..
i suspect its because not clossing connections as mentioned by Ben

can someone suggest me how to close connection in respect to the code AirportDD.java
as i am using different functions...
HTTP Status 500 -

type Exception report

message

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

exception

java.lang.NullPointerException
AirportDD.getFlights(AirportDD.java:34)
AirportSelectDD.doPost(AirportSelectDD.java:18)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.
7 years ago
hey i am writing a class file which takes values from database and adds them to arraylist and then a servlet uses those arraylist
to generate a web page..
the problem is that the servlet returns NULL POINTER EXCEPTION sometimes and sometimes the values are returned and are shown on the page.
usually this happens when i start the database and tomcat everything works fine but after refreshing the page 4-5 times or loading similar pages ..it starts to return NULL POINTER EXCEPTION ....i think this might be because of the fact that i am not closing the connections in the class file..
i am showing the code, can anyone suggest how to close connections according to this code.
Servlet

class file


thanks in advance
7 years ago
problem is solved ..
i was using user dsn but after creating a system dsn , its working
thanks every one...
the connection with jdbc was working fine when called from a class..
the problem started only when i started servlet.
previously a servlet was calling a class that had the code to get data from database but because of the problem
i tried putting all the code in the servlet only...
but still there is problem..
help
I ran this program to check the connection between my tomcat and JDBC
as i was having some problems in my web application..

result is
Good till now
SQLException is this: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified SQLState : IM002 VendorError: 0
Hello World. Sun... 1.4
can someone explain what to do??
i tried the following program to check the problem
and the exceptions were can anyone explain how to correct this??

result is
Good till now
SQLException is this: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified SQLState : IM002 VendorError: 0
Hello World. Sun... 1.4
how can i make sure that the application can find the JDBC drivers??
please help i am new to all this and this is my first application..
when i am calling the rs.next() function...
on line 26 of the code
i am getting null pointer exception so the catch is running ..
my oracle is running on 8080 because it clashed with Tomcat so i changed the port for tomcat from 8080 to 8081..
i will worry about resources after its running ..
can you explain the thin drivers..