Rajeev Asthana

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

Recent posts by Rajeev Asthana

Originally posted by Mark Spritzler:


What do you mean by this. That you haven't worked with Annotations, or you thing there is something inherently wrong with them?

I believe you can always just create the config files instead just like in 1.4.

Mark




I haven't worked with annotations and I don't know how many injections are there in Java EE 5.
Hi All,

Actually I'm not very comfortable with injections and annotations, so I wanted to code into Java EE 5 but without the annotations and injections, the way I used to code before.

Can I still do it in Java EE 5?

Thanks in advance
Rajeev.
Thanks...

Now I want to run the program to send a mail to Hotmail.

Please tell me what should be put in 'put' statement...

Thanks in advance
18 years ago
Hi,

As per Readme file, I compiled msgsh'ow.java successfully, but when I' running it by executing "java msgshow -" or java -classpath . mshshow -", it gives me error:

Exception in thread "main" java.mail.NoClassDefFoundError: javax/mail/MessageException.

Please help me in resolving it.

Thanks in advance,
Rajeev.
18 years ago
Thanks.

I downloaded. How to install it? Should I unzip contents into my Java directory?
18 years ago
Hi,

I am going to write first program that would send mails to users on Lotus Notes.

Can someone give me a little help how to start with...Any sample code..article....

Any help is greatly appreciated...

Rajeev. :roll:
18 years ago
Hi,

I am writing session beans and BMP Entity bean to insert, Update, Delete rows into database tables.

Insert seems simple to me as I have to just call create() in Session Bean which will call ejbCreate() in BMP entity bean and a row will be inserted.

What should I do to update a row?

Or delete a row.

Thanks in advance.

Rajeev

Originally posted by Nathaniel Stoddard:
Home methods aren't associated with a specific entity bean, while methods in the component interface are. You can read the EJB spec for component contract and usage issues.



Does this mean that I can call Home Business Methods without even "create"ing a bean ?

Then how these methods are associated? and with whom?
[ September 28, 2004: Message edited by: Rajeev Asthana ]

Originally posted by prashu bk:
hi Friends,
As we all know we have a ejbCreate(),ejbRemove()..so on methods in a bean,
But i'm unable to understand why they are called as "callback" methods???.
yes these methods will be invoked by the container to obtain the services for the bean.But still why these methods are called as callback.
Plz help me to understand it as u all have understood
thanx in advance
prashu



Container calls these methods during the lifecycle events of a bean. That's why they are callbacks.
Hi,

How are Home Business Methods of an entity beans different than business methods defined in Component Interface?

What is the difference in their usage?

Thanks,
Rajeev.

Originally posted by Jyothi Lature:
Try creating a synonym on the object and granting insert right to it...



I was trying all this in J2EE 1.4 SDK. I thought it'll take care of it.
Thanks for the suggestion.
I have created a database DEV and its URL is: jdbc ointBase EV.

I then added pbembedded.jar in CLASSPATH Suffix in JVM tab in Admin Console.

I also created a JNDI entry as jdbc/dev.

Then I created a table USER_SALARY in the schema PBPUBLIC.

I want to use the table in my Session Bean to insert rows in this table.

I specified it as:

...
ds = (DataSource)ctx.lookup("jdbc/dev");
conn = ds.getConnection();
pstmt = conn.prepareStatement("INSERT INTO PBPUBLIC.USER_SALARY (USER_NAME, SALARY) VALUES(?,?)");

pstmt.setString(1, userName);
pstmt.setDouble(2, (initialSalary*1.25));


updatecount = pstmt.executeUpdate();

.....

When I run the programs, I see that there is an error message in the server.log file:
"....table USER_SALARY is not found...."

What could be the error?

Any help is appreciated.

Thanks,
Rajeev.

Originally posted by Jyothi Lature:
Hi,

This could be achieved using Prepared Statement in JDBC API. ACtually, its no differnt from using this from any other db:

PreparedStatement ps2 = conn.prepareStatement(
"INSERT INTO TBL_NAME(COL1,COL2,COL3,COL4,COL5) "+
"VALUES(?, ?, ?, ?, ?)";
-- this sample code sets the values of dynamic parameters
-- to be the values of program variables
ps2.setInt(1, var1);
ps2.setInt(2, var2);
ps2.setDate(3, var3);
ps2.setString(4, var4);

updateCount = ps2.executeUpdate();

Incase, if you want to insert multiple rows, then you cud use batch transaction or put this in a loop..



Thanks, I tried following:

I have created a database DEV and its URL is: jdbc ointBase EV.

I then added pbembedded.jar in CLASSPATH Suffix in JVM tab in Admin Console.

I also created a JNDI entry as jdbc/dev.

Then I created a table USER_SALARY in the schema PBPUBLIC.

I want to use the table in my Session Bean to insert rows in this table.

I specified it as:

...
ds = (DataSource)ctx.lookup("jdbc/dev");
conn = ds.getConnection();
pstmt = conn.prepareStatement("INSERT INTO PBPUBLIC.USER_SALARY (USER_NAME, SALARY) VALUES(?,?)");

pstmt.setString(1, userName);
pstmt.setDouble(2, (initialSalary*1.25));


updatecount = pstmt.executeUpdate();

.....

When I run the programs, I see that there is an error message in the server.log file:
"....table USER_SALARY is not found...."

What could be the error?

Any help is appreciated.

Thanks,
Rajeev.
Hi,

I need an example where some rows are inserted in a PointBase table. The values are stored in some variables and those variables have to be passed to executeUpdate().

Any help is appreaciated.

Thanks,
Rajeev.

Originally posted by S Subramonyan:
Yes you can, for eg:

You have a webapp named test. You have a servlet class named MyServlet.class

You can specify any name for it in the dd element <servlet-name>, and you can map it to any url pattern you want.

eg: in web.xml,

<web-app>
......
..
<servlet>
<servlet-name>OhMy</servlet-name>
<servlet-class>MyServlet</servlet-class>
</servlet>
..
..

<servlet-mapping>
<servlet-name>OhMy</servlet-name>
<url-pattern>/OhMy</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>OhMy</servlet-name>
<url-pattern>/ohh.*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>OhMy</servlet-name>
<url-pattern>/foo.baz</url-pattern>
</servlet-mapping>

..
</web-app>

Hope this helps!



If this is possible, how Web Container knows where to locate the servlet when invoked from a HTML/JSP?