Kirtikumar Puthran

Ranch Hand
+ Follow
since Mar 04, 2003
Merit badge: grant badges
For More
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 Kirtikumar Puthran

Hi,
Actually, garbage collector runs as a low-priority thread. So I would also go for the option C. However I do agree with Anupam that "GC may be implemented differently by different compilers".
Hi Shashi,
<TEXTAREA NAME="kirti" ROWS="" COLS="" onFocus="this.blur();">asdasdad</TEXTAREA>
<html:SELECT NAME="" onFocus="kirti.focus();" onChange="kirti.focus();">
<option>1</option>
<option>2</option>
</html:SELECT>
hope this shud work
pls try this out with different verions of IE and Netscape...also u cud even show these fields in a different colour (probably grey) to indicate to the user that they are disabled.
20 years ago
Hi all,

I have written the following procedure with takes 3 input parameters and the 4th is an out parameter (i.e v_tab_hits) which is of TYPE PL/SQL TABLE.

I am stuck with the problem of retrieving the values from v_tab_hits in my Java program, any help is appreciated.

PSB: the Code Snippet


-----------------------------------Procedure -----------------------------------------------
TYPE rec_hits IS RECORD ( v_period VARCHAR2(100),
v_vis_cnt NUMBER(10),
v_hit_cnt NUMBER(10));

TYPE tab_hits IS TABLE of rec_hits INDEX BY BINARY_INTEGER;

PROCEDURE get_Hit_Daily( v_country IN VARCHAR2, v_sdate IN VARCHAR2, v_edate IN VARCHAR2,
v_tab_hits OUT cca_jtac_pk.tab_hits) AS

i NUMBER := -1;
CURSOR curec_hits is
SELECT to_char(access_date,'MM/DD/YYYY') AS access_date,
count(distinct(visitor_id)) AS visitors,
sum(TOTAL_HITS) AS total_hits
FROM CCO_TAC_VISITORS
WHERE country = v_country AND
access_date BETWEEN v_sdate AND v_edate
GROUP BY access_date;
BEGIN

OPEN curec_hits;
LOOP
i := i + 1;
FETCH curec_hits INTO v_tab_hits(i).v_period,v_tab_hits(i).v_vis_cnt,v_tab_hits(i).v_hit_cnt;
EXIT WHEN curec_hits%NOTFOUND;
END LOOP;

CLOSE curec_hits;
END get_Hit_Daily;

--------------------------------Java Code -------------------------------------------
CallableStatement cs = con.prepareCall("CALL cca_jtac_pk.get_Hit_Daily(?,?,?,?)");
//rset = stmt.executeQuery();
cs.setString( 1, country );
cs.setDate( 2, new java.sql.Date( fromDate.getTime() ) );
cs.setDate( 3, new java.sql.Date( toDate.getTime() ) );

//---------Q: What will be the Out Type Here......?
cs.registerOutParameter(4, Types.ARRAY );

cs.execute();

//----Q: How will I fetch data from v_tab_hits in Java Code


k.puthran@zensar.com
[ March 02, 2004: Message edited by: Kirtikumar Puthran ]
[ March 02, 2004: Message edited by: Kirtikumar Puthran ]
Hi all,

I have written the following procedure with takes 3 input parameters and the 4th is an out parameter (i.e v_tab_hits) which is of TYPE PL/SQL TABLE.

I am stuck with the problem of retrieving the values from v_tab_hits in my Java program, any help is appreciated.

PSB: the Code Snippet


-----------------------------------Procedure -----------------------------------------------
TYPE rec_hits IS RECORD ( v_period VARCHAR2(100),
v_vis_cnt NUMBER(10),
v_hit_cnt NUMBER(10));

TYPE tab_hits IS TABLE of rec_hits INDEX BY BINARY_INTEGER;

PROCEDURE get_Hit_Daily( v_country IN VARCHAR2, v_sdate IN VARCHAR2, v_edate IN VARCHAR2,
v_tab_hits OUT cca_jtac_pk.tab_hits) AS

i NUMBER := -1;
CURSOR curec_hits is
SELECT to_char(access_date,'MM/DD/YYYY') AS access_date,
count(distinct(visitor_id)) AS visitors,
sum(TOTAL_HITS) AS total_hits
FROM CCO_TAC_VISITORS
WHERE country = v_country AND
access_date BETWEEN v_sdate AND v_edate
GROUP BY access_date;
BEGIN

OPEN curec_hits;
LOOP
i := i + 1;
FETCH curec_hits INTO v_tab_hits(i).v_period,v_tab_hits(i).v_vis_cnt,v_tab_hits(i).v_hit_cnt;
EXIT WHEN curec_hits%NOTFOUND;
END LOOP;

CLOSE curec_hits;
END get_Hit_Daily;

--------------------------------Java Code -------------------------------------------
CallableStatement cs = con.prepareCall("CALL cca_jtac_pk.get_Hit_Daily(?,?,?,?)");
//rset = stmt.executeQuery();
cs.setString( 1, country );
cs.setDate( 2, new java.sql.Date( fromDate.getTime() ) );
cs.setDate( 3, new java.sql.Date( toDate.getTime() ) );

//---------Q: What will be the Out Type Here......?
cs.registerOutParameter(4, Types.ARRAY );

cs.execute();

//----Q: How will I fetch data from v_tab_hits in Java Code


k.puthran@zensar.com
[ March 02, 2004: Message edited by: Kirtikumar Puthran ]
[ March 02, 2004: Message edited by: Kirtikumar Puthran ]
20 years ago
First of all, sorry for the delay in reply....was trying to find a way out of this problem.

It should work the way you are doing.


---- yes, you are right Varun...it should have worked this way....luckily for me, it worked with a little tweak, though the charset of my database was UTF8...i think oci8 driver played the culprit over here...so i changed the way to connect to the database to include the charset (this was suggested to me by http://www.i18nfaq.com/java.html )....my previous code to connect to DB was :
String dsnFeedBack = "jdbc racle ci8:@hostString";
conn = DriverManager.getConnection(dsnFeedBack,"user","pwd");
i changed the above to :
String dsnFeedBack = "jdbc racle ci8:@hostString";
Properties props = new Properties();
props.setProperty("user", "user");
props.setProperty("password", "pwd");
props.setProperty("charset", "utf8");
conn = DriverManager.getConnection(dsnFeedBack, props);

This way it worked fine !!!

Can you tell me once you have insterted data in Oracle, how are you insuring that data is correct?


---- Now, with my previous code the data in the database was looking like "???" and inverted question marks......
With the above mentioned way, the values stored in the database are "Entity Reference Values" or "Numeric Character Reference (NCR)" for every character (something like 盙 read as &_#_xxxxx;_ ) ...this way when i retrieve the values from the database, it displays correctly on the webpage (JSP).


And what do u mean by **junk "Mojibake" characters** .. are they appearing like some memory address?


----"Moji Bake" means "Junk/Garbage characters".......In Japanese, "Moji" means "characters" and "Bake" means "to get funny or to get crazy"....so previously, when i used to retrieve the values from the database and display on the browser, it would appear as though they are Japanese characters...but they are not as some are converted appropriately and some characters are junk....so the whole word/sentence doesn't make any sense at all...hope this is clear to explain what "Mojibake" is

I too faced this problem earlier this year ... see my reply in this post to see that I went to solve it. But offcourse, my database for Sybase.


--- You are lucky that you could solve it....because the above way seemed to work for me only when there i have a self-submitting JSP i.e the input is taken from the user and the form is submiitted to the same page where the input (Japanese values) are stored in the database, retrieved from the database and shown back to the user.
When i tried to include this page within the another JSP, the same problem occured...though i had properly set the characterset of the JSP (in the META tag)....i am still trying to figure out a way which would work in any scenario....


I don't see any issue with Oracle as it supports UTF-8 stuff. Something going wrong in middleware it seems.

Let me know if you any suggestions on this matter.
Rgds,
Kirti
[ February 09, 2004: Message edited by: Kirtikumar Puthran ]
[ February 09, 2004: Message edited by: Kirtikumar Puthran ]
20 years ago
Hi,
I apologise if this is not the right forum to ask this question.
I am trying to insert Japanese data retrieved from a JSP page having
"shift-jis" charset into an UTF-8 oracle database.
I am using the following code to get the user input from the Form text box
field as follows:
String textboxString = request.getParameter("japaneseText");
String original = new
String(textboxString.getBytes("8859_1"));
byte[] JISBytes = original.getBytes("Shift_JIS");
String insertToDB = new String(JISBytes, "UTF8");
The string is then inserted in a UTF-8 database
But when the string is retrieved from the database using Java or Perl code,
the result is seen as junk "Mojibake" characters.
Note : When the data is inserted using a Perl script, the data is inserted
properly and the results are also retrieved properly in Japanese characters.
I would appreciate if someone could throw some pointers on this issue. (Even tried this using a servlet )
20 years ago
Hi,
I apologise if this is not the right forum to ask this question.
I am trying to insert Japanese data retrieved from a JSP page having
"shift-jis" charset into an UTF-8 oracle database.
I am using the following code to get the user input from the Form text box
field as follows:
String textboxString = request.getParameter("japaneseText");
String original = new
String(textboxString.getBytes("8859_1"));
byte[] JISBytes = original.getBytes("Shift_JIS");
String insertToDB = new String(JISBytes, "UTF8");
The string is then inserted in a UTF-8 database
But when the string is retrieved from the database using Java or Perl code,
the result is seen as junk "Mojibake" characters.
Note : When the data is inserted using a Perl script, the data is inserted
properly and the results are also retrieved properly in Japanese characters.
I would appreciate if someone could throw some pointers on this issue. (Even tried this using a servlet )
20 years ago
Hi,
I apologise if this is not the right forum to ask this question.
I am using Struts framework for my application. I am trying to insert Japanese data retrieved from a JSP page having
"shift-jis" charset into an UTF-8 oracle database.
I am using the following code to get the user input from the Form text box
field as follows:
String textboxString = request.getParameter("japaneseText");
String original = new
String(textboxString.getBytes("8859_1"));
byte[] JISBytes = original.getBytes("Shift_JIS");
String insertToDB = new String(JISBytes, "UTF8");
The string is then inserted in a UTF-8 database
But when the string is retrieved from the database using Java or Perl code,
the result is seen as junk "Mojibake" characters.
Note : When the data is inserted using a Perl script, the data is inserted
properly and the results are also retrieved properly in Japanese characters.
I would appreciate if someone could throw some pointers on this issue.
20 years ago
Hi,
I am trying to insert Japanese data retrieved from a JSP page having
"shift-jis" charset into an UTF-8 oracle database.
I am using the following code to get the user input from the Form text box
field as follows:
String textboxString = request.getParameter("japaneseText");
String original = new
String(textboxString.getBytes("8859_1"));
byte[] JISBytes = original.getBytes("Shift_JIS");
String insertToDB = new String(JISBytes, "UTF8");
The string is then inserted in a UTF-8 database
But when the string is retrieved from the database using Java or Perl code,
the result is seen as junk "Mojibake" characters.
Note : When the data is inserted using a Perl script, the data is inserted
properly and the results are also retrieved properly in Japanese characters.
I would appreciate if someone could throw some pointers on this issue.
Rgds,
Kirti
20 years ago
JSP
Hi all,
What is an entity bean and a session bean?
What is the difference between the both of them?
Are there any advantages of using one over the other?
Rgds,
Kirtikumar Puthran
Hi all,
I am relatively new to EJB... so this question might sound a little premature.
I would like to know what is the difference between Java Bean and an EJB ?
TIA,
Kirtikumar Puthran
Hi David,
Thanks a lot for your response.
Certainly there are a lot of public classes in which System.exit(n) is written. But, then what is the alternative to this, say in case if a particular condition occurs, I want to stop the processing of that code....and I thought System.exit(1) was the way to do it.
How do I change this to do the intended task?
Rgds,
Kirtikumar Puthran :roll:
21 years ago
Hi all,
I am sorry for posting this topic on this forum. I have posted this topic in the Apache/Tomcat forums....but seems no one is interested in answering this query over there. I will appreciate if someone atleast shows me a way so that I can venture out further.
I have a serious problem at hand. The tomcat service on our live production server has to be restarted every now and then, as it stops abruptly after a certain time.
Our application uses Apache as the web server and Tomcat as the servlet engine. Can someone please throw some light on this matter ? Can this problem be minimized upto a certain extent if not totally ? Are there any parameters to be set which improves the performance of tomcat.


TIA,
Kirtikumar Puthran
21 years ago
Can someone help me on this topic ???
Rgds,
Kirtikumar Puthran