Rakesh Keerthi

Ranch Hand
+ Follow
since Jul 16, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rakesh Keerthi

Hi,

I'm working on a code where I need to find a string from a set of sentences, match if the string is in another keywords list and from there get the appropriate value from map and replace in original list.

Here is my code



When I run this code the output that I get is as below.

Original strings: [bread gingerbread vegan, iced tea lmn gngr grn 32, iced tea lmn]
New strings: [breadd gingerbreadd vegetarian, iced tea lemon ginger green 32, iced tea lemon]



but my expected output is as below

Original strings: [bread gingerbread vegan, iced tea lmn gngr grn 32, iced tea lmn]
New strings: [bread gingerbread vegetarian, iced tea lemon ginger green 32, iced tea lemon]



Here I want to find entire match in rawTitleList from dictKeys and replace the value using the value from dictMap.

please let me know where am I going wrong and how can I fix this.

Thanks,
Sunny
6 years ago
Hi,

I'm writing a Web app and using Excel as backend as i'm not supposed to use anyother. Here in my code i am performing a jdbc on 2 tables. Insert in 1 and Update in another. Ans below is my code.



Here my problem is, when i hit submit, the insert part is getting correctly posted. But the update part is a bit tricky and confusing.
The System.out.println() is printing everything as expected, and to post the data I'm going to my code, delete a line, undo a delete, Save it. and i get the below message in my eclipse console.




Once i get the above message, the other sheet is getting updated.

What i'm confused is, why am i doing this for the second table but not for the first. The first is getting inserted without any issues.

Please let me know how can i fix this.

Thanks,
Rakesh
9 years ago
Hi All,

If anyone have such problem, I've found a solution that worked for me.

use an id for the form like



Then for the button add an onClick event as below

<input type="button" value="Submit Form" onclick="getLastDate()" />

and in the javascript in <head>, use the below method. Make sure that the method name is same as the onClick event attribute value.

Here i need to fill a text box with current time, so i used the below code, you have to change as per your requirement.



This is solution for my first question.

For time delay i.e. my second question.

Use a setTimeout method in javascript as below. Here 3000 means 3 seconds.



This has to be given wherever you want a time delay,

In my case, i need to get the time in text box, pause it and then submit the form data, so i took this after the time is fetched (please refer to my third code block for full js method).

This is how I've solved my problem.

Cheers,
Rakesh
Hi,

I've below jsp.



Here I've 2 questions,
  • I'm unable to submit my data to database using a button through JavaScript. Using a submit type is good, but here i need to fill a textbox(id = endTime) with date and time when i hit submit. That's why I've used it as a button instead of submit. I thought that the button is not working, but when ever i click on that button the latest time is fetched into textbox(id = endTime).
  • I need a small pause of say 2-3 seconds after the time is generated in the textbox and then the post should be done.


  • Please let me know how can i get this and where am i going wrong.

    Thanks.

    Bear Bibeault wrote:Why use toString() rather than a getter (accessor) that gives you the value that you want?



    Hi Bear,

    Thanks for this tip. I did it (using below) and got the result as expected.



    Thanks Again
    :beerchug:
    9 years ago
    JSP

    K. Tsang wrote:Are you meant to display just the first item or all the records in the list?

    If the latter, better to use the <c:foreach> to loop through the list.



    Hi Tsang, I don't want to retrieve all the values, i want only the first value to be retrieved.
    9 years ago
    JSP
    Hi,

    I've the below DAO File.



    And the below Servlet



    Here i'm trying to print the first value (caseNumber) in a jsp textbox using the below code.



    But the output i getting is as below



    but instead of this i need the exact value at there. please let me know where am i going wrong and how do i fix it.

    Thanks,
    Sunny
    9 years ago
    JSP
    Got it. This is for reference, just in case someone gets the same problem.

    9 years ago
    Hi,

    I'm writing a Java program to fetch data from Excel sheet.

    From the below program, i'm able to retrieve the entire data.



    But here my case is there are nearly 45-47 columns and out of there there is some data which is not required(for me, but needed for some other teams). Every column has a heading, and out of these 45-47 columns i want to pull data only from 12 columns, and there are randomly placed between the rest of columns in Excel sheet.

    And I need to retrieve only a set of column data from the Excel Sheet. I'm trying to do it with the below program.

    I've initialized the columns from where i need to retrieve data in a string named colIndex.



    I'm getting the below error



    I'm using Apache POI.

    please let me know how can i fix this.

    Thanks,
    Sunny
    9 years ago
    Got it thank you very much. :-)
    10 years ago
    when i'm trying to use the correct format it doesn't show the correct output in the query, if the format is modified, then i get the correct format with an exception
    10 years ago
    Nop. I'm getting the Exception if i change the format.
    10 years ago
    Yes that is right when i use

    the output is


    when i use

    the output is
    10 years ago
    Sorry, that was a typo in my sql string. updated it, but still the same output

    10 years ago
    Below screenshots shows the input and the query generated.

    The red boxes represents the dates.
    10 years ago