Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!

Chak Terlapu

Ranch Hand
+ Follow
since Oct 20, 2000
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
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chak Terlapu

Hi Nanhesru,
Is it from "Ode to a Nightangle"..correct me if i am wrong as I remember reading it in my good old days(school)
18 years ago
Hi,
I am using TableModel to connect to a database and display the results. I am unable to display the table. It doesn't display anything. Below is the code from the TableModel I am using to connect to database. Could anyone help me find the errors please. any help would be ggreatly appreciated.
Thanks
18 years ago
Is the database on the same machine as your applet code? If it is on a different machine then you cannot do it because of applet security features. In that case you need your applet to call a servlet program in order to connect to a remote database.
18 years ago
Hi,
I think the problem is that the database resides on a different machine from where the applet originates. Is there a fix to this problem. Can we make it work if the database is on a different machine. Is it because of applet "security issues" that we might not be able to do this. Could you answer these questions please
Thanks
Chak
18 years ago
Hi,
I am trying to connect to a database and display the results in an applet using JTable. I am using a TableModel in which I have the following statements:

When I try to view the applet from the browser, I get an error in Java console saying "Cannot connect to this database: No suitable Driver". I tried a simple java program that connects to a databse and displays the results at stdout and I was successful. I am unable to figure out what might be the problem. Could anyone
please help me out?
Thanks in advance
Chak
18 years ago
Hi,
I have three buttons in a form. Each button passes control to a different servlet when clicked. The problem is it is not passing any parameters when button is clicked. When i used the buttons individually everything works fine, the parameters are received correctly. Could anyone tell me what the problem might be.
18 years ago
Hi,
When I am trying to call servlet B from servlet A the parameters are not getting passed and null value is returned.
servlet main.java: displays a table and adds checkbox to each row:

if i just call action like above null values are returned for value of i but if use as below then value is passed:
out.println("<Form method=\"post\" action=\"http://rupd1b42:8159/servlet/delete1.class?abcd=59\"><TH>");
but still the values of check boxes are "null". I am trying to receive parameters as follows:

Any help would be appreciated.
Thanks
Chak
18 years ago
Hi,
I am just trying to debug it by printing the output in the logs. I actually need to know the check box number (i.e. from icheck[10] the value of 10) which has been marked by the user, with the help of which i will be able to relate it to the rowid of the table row. The rowid's are all stored in an array, so if i can know the rowid i will be able to delete the marked row.
thanks
18 years ago
Hi,
I also tried in a different approach but without sucess:

[code]
//receiving parameters
cont.log("value of num: "+req.getParameter("number"));
int num1 = Integer.parseInt(req.getParameter("number"));
for(int i=0; i< num1; i++)
{
String ch = req.getParameter("icheck"+i);
cont.log("check: " +ch);
}

[code]
It is failing at req.getParameter("number"), which i cant understand as the "number" name exists.
18 years ago
Hi,
Itss so strange the same thing is not working for me. It does not print anything in the log files.


and I am trying to retrieve it using:

Thanks
18 years ago
Hi,
Thanks for the response. I tried your way but no luck. Can anyone help me correct my approach.
Thanks
18 years ago
Hi,
I tried it but with no luck. I cant understand where the problem is.
I checked in the view source the name of the checkboxes, everything is fine, the name ranges from icheck[0], icheck[1] ..icheck[58].
I am getting null value for also the checkboxes that are marked.
Thanks
18 years ago
Hi,
I am using a servlet to display a table, and i am assigning a check box to each table row as follows:

the table has a "delete" button at the bottom. When the user clicks on some check boxes and clicks the delete button the rows should be deleted. I am trying to capture the checkbox events as follows:

The problem is when i click on some check boxes and click "delete" button a null value is returned for all the checkboxes.
it would be great if anyone could help me.
thanks
18 years ago
Hi,
I have a servlet "main.java" which connects to a database and displays a table. The table contains a check box in front of each table row. It has three buttons at the bottom "add" modify" "delete". When the user clicks on some check boxes and clicks on "delete" button how can i know in the script delete.java that these are the check boxes that have been checked or selected. I tried to do in the following way
String[] checkedBoxes = new String[100];
checkedBoxes = req.getParameterValues("sel");
where sel is the name of the checkboxes
but I am getting the following error:
[21/Aug/2001:10:36:54] failure ( 1118): Internal error: exception thrown from the servlet service function (uri=/servlet/delete.class):java.lang.NullPointerException, Stack: java.lang.NullPointerException
Any help would be appreciated.
Thanks
Chak
18 years ago
Hi,
Thanks for the reply and I am sorry it was a mistake to mention "When button in Servlet A..." I have another question.
I have two servlets A and B. When a button in HTML page created by Servlet A has been clicked the control goes to another HTML page which contains a button, when clicked invokes servlet B. Now how can I make the control go from Servlet B to servlet A after the doPOst method is executed in Servlet B. The doPOST method in servlet B does a database operation. Can I add a statement at the end of doPOST method such that after executing the database operation the page created by servlet A gets displayed.
Thanks
Chak
18 years ago