Rasmeet Devji

Greenhorn
+ Follow
since Dec 08, 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 Rasmeet Devji

Hi there,
You could possibly get your piece of code posted here, that would give a clear picture of what you are trying to do.
One reason could well be the usage of the type of datasource you use. TX DataSource to be used for transactions. Give it a shot and do give your feedback.
Regards.
Stateless Session Beans could be used for transactions involving more than one table. This is where your Java Transaction API and TX DataSource come into picture.
You could get the Transaction object from the EJBContext's getUserTransaction() method
and then, get your SQL statements in place within a try and catch block.
Remember, you need to use the transaction.begin(), transaction.commit() and transaction.rollback() methods to ensure your transaction works fine !!!
Hope this helps.
Regards.
Hi Paulo,
Just to add a little more to what is already been said, EJBContext is one of the 3 ways you could make callbacks to your EJB Container.
The others are your methods of the Session and Entity beans like ejbActivate(), ejbPassivate(), etc., and then we have the lookup() methods which look up the objects using the JNDI.
Dont you worry about EJB, you would fall in love with it
Good luck,
Rasmeet.
Hi people,
The following is a piece of code, my first try on JavaMail API....
public class SendMail {
public static void main(String[] args) {
try {
String host = "smtp.vsnl.com";
String from = "rasmeet_d@yahoo.com";
String to = "sekhar_ks_us@yahoo.com";
// Get system properties
Properties props = System.getProperties();
// Setup mail server
props.put("mail.smtp.host", host);
// Get session
Session session = Session.getDefaultInstance(props, null);
// Define message
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject("Hello JavaMail");
message.setText("Welcome to JavaMail");
// Send message
System.out.println("Sending the message.......");
Transport.send(message);
System.out.println("Message sent..............");
}catch(Exception ex){
ex.printStackTrace();
}
}
}
The output -
Sending the message.......
Sending failed;
nested exception is:
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
javax.mail.SendFailedException: 554 <rasmeet_d@yahoo.com>: Sender address rejected: Access denied
The mail ids here are valid and infact I also tried some other non-yahoo / hotmail ids, but it still does not work !!!
Any fixes to be done to the code ??
Regards.
Hi!
I got to store the current date and time in a Timestamp variable, i could retrieve the current date and time using
Calendar cal = Calendar.getInstance(TimeZone.getDefault());
cal.getTime();
but the method of getTime() returns a date object where as i need a Timestamp object, now how do i convert a date object into a Timestamp object??
Please try and reply on this one!
Regards!
21 years ago
Hi!
I got to store the current date and time in a Timestamp variable, i could retrieve the current date and time using
Calendar cal = Calendar.getInstance(TimeZone.getDefault());
cal.getTime();
but the method of getTime() returns a date object where as i need a Timestamp object, now how do i convert a date object into a Timestamp object??
Please try and reply on this one!
Regards!
21 years ago
Hi!
I got to store the current date and time in a Timestamp variable, i could retrieve the current date and time using
Calendar cal = Calendar.getInstance(TimeZone.getDefault());
cal.getTime();
but the method of getTime() returns a date object where as i need a Timestamp object, now how do i convert a date object into a Timestamp object??
Please try and reply on this one!
Regards!
Should i be doing this in the policy file ?
Thanks!
Hi Rajesh,
Thanks for replying.
Guess I forgot to mention the flow, let me explain
I have a servlet which loads an applet. Now this applet tries to access a servlet and all these class files reside on the same machine. The machine acts as a client and the server.
Hope this'll help you understand the problem better
Still awaiting for the right one,
Thanks!
Rasmeet
21 years ago
Hi all!
I have developed a chat application wherein an applet tries to access a servlet (through a method of a different class) using URL and URLConnection.
It works really fine on Internet Explorer 5.0 (and earlier ver) but not on Netscape 4.75 (and earlier versions).
This is the exception it throws :
General Exception: security.class from local disk trying to access url: http://rasmeet:8080/servlet/ChatServlet
Anyone to help me ?
Thanks !
Hi all!
I have developed a chat application wherein an applet tries to access a servlet (through a method of a different class) using URL and URLConnection.
It works really fine on Internet Explorer 5.0 (and earlier ver) but not on Netscape 4.75 (and earlier versions).
This is the exception it throws :
General Exception: security.class from local disk trying to access url: http://rasmeet:8080/servlet/ChatServlet
Anyone to help me ?
Thanks !
21 years ago
Hi all!
I have developed a chat application wherein an applet tries to access a servlet (through a method of a different class) using URL and URLConnection.
It works really fine on Internet Explorer 5.0 (and earlier ver) but not on Netscape 4.75 (and earlier versions).
This is the exception it throws :
General Exception: security.class from local disk trying to access url: http://rasmeet:8080/servlet/ChatServlet
Anyone to help me ?
Thanks !
21 years ago
Hi people !
I wanted a bit of help from you guys......
I have developed a chat application and am trying to add some features into it.
Right now I'm trying to format the messages with different fonts and styles, which doesn't seem to work fine.
My idea was to set the font style and size of each individual message according to the user preferences.
Any idea how I could do this.......??
Thanks and regards,
Rasmeet
21 years ago
Hi Ray,
Thanks for the reply, but i'm afraid it did'nt help me much.
May be i'll explain it clearly. I have a servlet which embeds the html part (user interface).
When i tried calling the method of the applet, it didn't work out well
here's the sample code :
out.println("<html>");
out.println("<head><title>Mindteck Chat</title></head>");
out.println("<script language = 'javascript'>");
out.println("function logout()");
out.println("{");
out.println("var msg = \"leaves the room\" ");
out.println("document.chatapplet.broadcastMessage(msg)");
out.println("}");
out.println("</script>");
out.println("<body background=\"http://rasmeet:8080/gray.jpg\" onUnload = \"logout()\">");
out.println("<applet name = chatapplet code = "+ applet1 +
" codebase=/ " + "width = 600 height = 300>");
if(client != null)
{
out.println("<PARAM NAME = client VALUE=\" " + client + "\">");
}
out.println("</applet>");
out.println("</body>");
out.println("</html>");
what could be the reason ?
Thanx again !!
21 years ago
Hi guys!!
I need to know if it were possible to trap the event of a browser window getting closed, in java.
The reason why i want to do is this :
I've a chat application where in i have a logout button.
Now if the user clicks the logout button, i update his record back in the database and sign him off.
So far so good......
But the problem is, what if the user closes the browser window directly, i.e. without clicking on the logout button.
In any case i need to update his record, but how do i do this ???
Anyone to help me out ???
Thanks all !!
21 years ago