Nilesh Soni

Greenhorn
+ Follow
since May 14, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Nilesh Soni

Ben and Angel,
First of all thanks for quick reply.

After reading post from both of you, I am having some more questions for which I am not able to google proper answers.

1) For getting PersistentList instead of PersistenBag, we have to implement IndexColumn annotation and hence we have to create an extra column into the table. Why on earth, such kind of weird requirement? What if I don't want to have a dedicated column in DB for such solution?

2) Is it that hibernate will always going to return collection of PersistentXXX type only whenever we will find an Entity (having a member variable as a Collection) using EntityManager.find() method?
If I will implement the solution as specified by Ben, still I will get PersistentList, while my requirement is an ArrayList. So onus is on me to do the conversion as follows:



I hope I am not asking for too much.

Regards.
Hi All,
I have 2 entities (Category and Products) having one to many relationship between them. My architecture is having Spring (in business Layer) and am using Hibernate under the hood of JPA. I am using annotations for all my configurations. Please see the attached code.

Inside the finder method of a DAO, I am finding (EntityManager.find()) the parent entity. The problem is that the child property of this parent (which is a collection of type ArrayList) is actually returned as PersistentBag.

What should I do so that the getter method of my parent will return me collection of type ArrayList?



Do anyone has any idea?

Regards.
Hi all,
I want to know how much threads are running in my weblogic 7.0 by some API like JMX. I can found a sample code for monitoring memory. I want a sample code for monitoring threads so that i can plug-in in my code. If any of you have and can send me, I would be thankful to you. Or else any doc which provides sufficient details, then i can go on try coding myself.

Thanks in advance.
19 years ago
Hi,

I want to retrieve text (inside PDF doc) through some java api (programmatically, like we retrieve a line from .txt file in a String variable) so that I can further process it as per my wish.
My actual requirement is that i want to read text inside that PDF doc and also tell me whether it is necessary that i need to have position of that text (x, y coordinates). Your help would be helpful to me. Also oblige if u can send me a sample code..

Thanks and Regards
Nilesh Soni
[ November 16, 2004: Message edited by: Nilesh Soni ]
20 years ago
To All,

I have created one CMP Bean and in that CMP bean, I have one method declaration as follows (which will be implemented by the container).

public abstract void setReturnName(String returnName);

I am calling this method from another method (which is declared and defined in the same CMP) like this.

public boolean changeData(ReturnTypeTO returnType)
{
setReturnName("Return Type");
return true;
}

Now the problem is that in the database, if i look at the value, there are some junc characters are stored (and that is also starting 3 characters only)
I have perfectly defined the field name and everything in DTD.

I am using Oracle 8.1.7.0.0
and we are using classes12.zip for database drivers.


Can somebody throw light in this case...

Thanx...
Thankx chris,
I have a javascript through which u can change the default home page property of browser (in Tools -> Internet option). If this can be done then why not the footer values in Page setup.
Nilesh
Hi all,
I want to change some property of the browser through javascript. for example to clear the header and footer values in File -> page setup to blank. This way when i will print the page through javascript's window.print(), nothing will be printed in header or footer. This is very urgent and i will oblige all who will attempt to solve this.
Thank you in advance.
Hi to all,
I want to print the page currently opened in the browser. I can do that through window.print() but the problem is that the printed page also have file/url name at the end of the page. How can i remove that?
Please help me put?
Thanx in advance.
Hi all,
I am drawing some lines or any shapes in an applet. now i want to save that drawing or applet into an image like gif or jpeg. one funda is that we will click on one button on applet, it will contact a setvlet on the server and on the server i have to write some code.
I got reply from one of the javaranch member Tim Holloway as follows:
You'll need to convert the applet's canvas into a bitmap, convert the bitmap into JPEG or GIF format, then send the bitmap in a binary file transmission to the server. The server really can't do anything but catch the file - all the work has to be done on the client.
Can any one help me out in this regards.
------------------
23 years ago
Hi all,
I am drawing some lines or any shapes in an applet. now i want to save that drawing or applet into an image like gif or jpeg. one funda is that we will click on one button on applet, it will contact a setvlet on the server and on the server i have to write some code. can any one help me out in this regard as i need it very very urgent.
thanks.
------------------
23 years ago
Hi all,
I seek a very urgent and important help from you all. I am working with jsp and SQL Server 7. My requirement is something like this.
I have 2 tables. One is the master table (suppose EmpMaster) in which all employees information is stored like name, address etc. in the second table (suppose EmpTran) i am having 2 fields viz. Id and UserIds. In EmpTran, I am storing data like this.
ID UserIds
1 3,4
2 1,5
The numbers seperated by comma in UserIds field is Ids of employees whose info. is stored in EmpMaster. Now i want to
1) write a stored procedure which can retrieve data/rows from EmpMaster based on Id of EmpTran passed to the procedure.
2) how to call that procedure from java and
3) how to retrieve values returned by procedure.
So the process would be something like this as i have tried myself to solve this problem.
i will call the procedure by passing a Id to that procedure. Suppose i have passed 1. based on that Id, inside procedure i will get UserIds 3,4. i need to seperate them inside procedure itself. so i will get 3 and 4 seperately. then I will do query "select Name, Address from EmpMaster where Id=3 or Id=4" Now whatever result will be retrieved, that is to be sent back. and In Java/jsp i want to retrieve that data.
To solve my problem i have started writing procedure but stuck at the starting only as I cannot retrieve the simple string also like "3,4" from procedure.
I know it may be discouraging to u all as i am asking too much, but if you people can help me to solve, why i cannot retrieve the data from procedure only, I will be greateful to you.
Thanks in advance. Code tried by me are as follows.
SQL server 7 procedure :
CREATE PROCEDURE GetDetails
@Id numeric ,
@@IdString varchar(100) output
AS
BEGIN
select @@IdString=UserNames from HoliPackageTran where Id = @Id
END

RETURN @@IdString
Java code which i used to retrieve the data:
cs = con.prepareCall("{call GetDetails(?,?)}") ;
cs.setInt(1,1) ; //
cs.registerOutParameter(2, java.sql.Types.VARCHAR) ;
if(cs.execute()) { //if execute() returns true, it means resultset is returned
r = (ResultSet)cs.getObject(2);
while(r.next()) {
out.println(r.getString("UserIds")) ;
}
}
else {
String str = cs.getString(2) ;
out.println(str) ;
}
cs.close() ;
Exception raised
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting the varchar value '3,4' to a column of data type int.
First of all i cannot understand why it is giving me this exception as i am not trying any where to convert the string returned as '3,4' into int. If any one of you will help me out i will be greateful to you.
------------------
Hi all,
i am developing an application in jsp, servlets. I have started my Java Web Server by this command
httpdnojre -javahome C:\jdk1.3
I am using jre of JDK 1.3 to start java web server instead of jre of java web server because i want to use HashMap class in my application. As HashMap.class is not included in rt.jar of javawebserver2.0's jre. After doing this i have developed the application. Everything works fine but as i need to insert mailing module in my application, problem started as mail cannot be sent. It gives me exception like this.
access denied (java.net.SocketPermission 198.165.34.150:25 resolve)
i have tried to discover the cause behind this and i found that as i am using jre of JDK to start java web server, it is giving me this exception. Then i closed java web server and start it once again using jre of java web server itself by giving command:
httpd
this way my mailing module works fine but my application doesnot run as i have mention above that it doesnot get HashMap class. Now i am confused what to do as my application are not running on (httpd) and i cannot send mail on (httpdnojre -javahome C:\jdk1.3). Please try to send me the solution as early as possible as i am helpless now.
Thank You.
Nilesh Soni

------------------
23 years ago
julio,
thanx for your efforts, but what i wanted was not so simple as you have understood. i wanted the rows of master tables also which has no similar records in transaction table. finally i got the solution by using left outer join. may be i was not able to write the exact solution what i wanted. but any way thanx.
bye
------------------
Hi all,
My problem is something like this. I have a Master table and a Transaction table. I am executing a query which retrieve all the Ids from Master table and then as the Ids are getting from resultset i want to fire another query (while the first resultset is executing) which gets data from Transaction table if it has the record of same Id as of Master.
Coding is as follows:
query = "Select Id,Name from Master" ;
while(r.next()){
CompId = r.getInt("Id") ;
System.out.println(r.getString("Name")) ;
query = "Select Distinct(TransId) from Transaction where TransId = "+CompId ;
r1 = s.executeQuery(query) ;
while(r1.next()){
System.out.println(r1.getInt("TransId")) ;
}
}
while executing this the first resultset (r in our case) gets closed automatically. can anyone help me solving this problem.
Thank You.
Nilesh Soni
------------------
hi all,
i have created a HashMap and in which i am storing my all Sessions. Inside session i am storing an object Of type User class (I have called User class inside .jsp page as a Bean). so codingwise it's like this after creating User user object.
session.putValue("user",user);
monitor.put(user,session) ;
(the session is object Of HttpSession, bydefault we get it in .jsp page and monitor is object Of HashMap class which, i included as a Bean having application scope).
Then i set Maximum inactive time to 200 seconds.
session.setMaxInactiveInterval(200) ;

now the problem is that after 200 seconds session is expire but the HashMap is still having it's objects/entry in it (naturally). so how can i remove it from HashMap as soon as session's time period is over.
i have taken somewhat step for the solution. They are as follows.
1) i have implement HttpSessionBindingListener in Class User and override it's both the methods valueBound() and valueUnBound()
2) when session gets removed valueUnBound() is called successfully but how can i remove the session object from HashMap as we can't access HashMap inside User class.
I hope i have clearly write the question and get someone to help me out.

------------------

[This message has been edited by Nilesh Soni (edited May 30, 2001).]
23 years ago