karai baskar

Greenhorn
+ Follow
since Nov 29, 2000
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 karai baskar

tku friend,
i tried in both ie5.5 and netscape.both giving the same error.
i am using jdk1.2
bye
22 years ago
hi friends,
i have created applet with 50 buttons having numbers as labels
generated using random class.it's working good in appletviewer
but when i run it in browser it says
error:java.lang.NosuchMethodError:java/util/Random:method nextInt(I) not found .
But the methods nextInt(I) is there in random class where I is a seed value
pl i need an explanation
tku
baskar
22 years ago
hi friends,
in my program i have opened a Real Player and play a song.
everything is ok.can anyone tell me how to make the
realplayer invisible when playing.
looking for your's,
baskar
22 years ago
thanks rahul,
but how to make my system smtp enabled ot start the service as
you said.If if you give me details of this,i will be happy
bye
22 years ago
hi friends,
for long time i am trying this code to send mail using
java mail.classpath was set.no error in compilation.error during runtime(error posted)
here is the code
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class JavaMail
{
public static void main(String ar[])
{
String host="192.168.0.1";//this is my system ip address
String to="knbaskar@usa.net";
String from="om_omprakash@rediffmail.com";
String subject="Testing";
String message="This is to test wheteher java mail is working";
Properties pop=System.getProperties();
pop.put("mail.host",host);
pop.put("mail.transport.protocol","smtp");
Session ses=Session.getDefaultInstance(pop,null);
boolean sessiondebug=false;
ses.setDebug(sessiondebug);
try
{
Message msg=new MimeMessage(ses);
msg.setFrom(new InternetAddress(from));
InternetAddress[] address={new InternetAddress(to)};
msg.setRecipients(Message.RecipientType.TO,address);
msg.setSubject(subject);
msg.setSentDate(new Date());
msg.setText(message);
Transport.send(msg);
System.out.println("sent");
}
catch(MessagingException mex)
{
mex.printStackTrace();
}
}
}
error message
javax.mail.SendFailedException:Sending Failed
nested exception is
javax.mail.MessagingException:Could not connect to SMTP host:192.168.0.1
Please help me in this.
thank u
22 years ago
The following code works well with jvm.but it fails to answer when the same code is used a jsp bean
The following is bean file
package rand;
import java.util.Random;
public class rand {
int b;
Random r=new Random();

public rand(){
b=r.nextInt(7);
}
public int getrand(){
return b;
}
public static void main(String arg[]){
rand r=new rand();
System.out.println(r.getrand());
}
}
The following is jsp file
<%@ page import="java.util.Random" %>
<%
java.util.Random r=new java.util.Random(7);
int i=r.nextInt();
out.println(i);
%>
it gives the following error
Error during JSP page processing
java.lang.NoSuchMethodError: java.util.Random: method nextInt(I)I not found
Pls solve the above problem as quick as possible
23 years ago
hi,
just try this to upload.i got this from download.i didn't
try this.give reply after tried this

String cmdline = "C:\\windows\\Ftp.exe pretty.jpg";
Runtime myRun = Runtime.getRuntime();
Process p = null;
try{
p =myRun.exec(cmdline);
}
catch(IOException ioe)
{
System.out.println("Exec failed: " + ioe);
}
p.waitFor();

bye
baskar
23 years ago
hi,
let me know how to send mail in jsp
thanks
23 years ago
hi,
yes i am using jdbc2.0 api supported driver.
i get the exception when the first statement
st.addBatch( ) gets executed.
bye
baskar
hello friends
what is thin and oci driver.where i will get it.
how to use that in my program
will u pl guide me in this.
thanks for all
bye
baskar
hello friends
i am getting unsupportedoperation exception when i run this
program
import java.sql.*;
public class batch
{

public static void main(String arg[])
{
Connection conn=null;
ResultSet rs=null;
Statement stmt=null;
ResultSetMetaData rsmd=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc dbc:rst");
stmt=conn.createStatement();

conn.setAutoCommit(false);

stmt.addBatch("INSERT INTO student " +
"VALUES('Amaretto', 49, 'm')");
stmt.addBatch("INSERT INTO student " +
"VALUES('Hazelnut', 49,'m' )");
stmt.addBatch("INSERT INTO student " +
"VALUES('Amaretto_decaf', 49,'m')");
stmt.addBatch("INSERT INTO student " +
"VALUES('Hazelnut_decaf', 49,'m')");
int [] updateCounts = stmt.executeBatch();
System.out.println("inserted");
}
catch(ClassNotFoundException e){}
catch(SQLException sq){}
}
}
there is no error but operation not supported.what to do
pl help me in this
thanks for all
bye
baskar
helo friends,
i want to know the driver path to connect with sql database
using jdbc.let me know both the dsn and dsnless connection
driver path.is any special driver classes i need?
do i have to set any classpath for that.
please help me in this
thank you for all
baskar
hai i hope this will help u
An abstract class cannot be instantiated. Only its subclasses can be instantiated. You indicate that a class is abstract with the abstract keyword like this:
public abstract class Container extends Component {
Abstract classes may contain abstract methods. A method declared abstract is not actually implemented in the current class. It exists only to be overridden in subclasses. It has no body. For example,
public abstract float price();
Abstract methods may only be included in abstract classes. However, an abstract class is not required to have any abstract methods, though most of them do.
Each subclass of an abstract class must override the abstract methods of its superclasses or itself be declared abstract.
For more details, see section 8.1.2.1 of the Java Language Specification.
What's an interface?
An interface is an idea taken from Objective C. It describes the public methods that a class implements and their calling conventions without saying anything about how those methods are implemented. It is the responsibility of each class that implements an interface to provide code to handle the cases where the methods of the interface are called.
For example suppose you're writing an inventory database. The inventory may include many different items of many different types and classes. However each item in the warehouse needs to be able to tell you its price. Normally you would implement this by having each class extend a common superclass. However that's not always convenient. Instead you can declare an interface called Price with a price() method like this:
public interface Price {
public float price();
}
Any class which implements the Price interface must contain a method with the signature public float price(). The code of the price() method is included separately in each separate class which implements Price, not in the Price interface itself.
Different classes in your warehouse can each implement the Price interface like this:
public class Monopoly extends BoardGame implements Price {
// other methods
public float price() {
return 14.95;
}
}
When other code is passed an object, it can test whether the object implements Price with the instanceof operator. For example,
if (o instanceof Price) System.out.println("Subtotal is " + o.price());
In fact, interfaces can be used to tag objects. The java.rmi.Remote interface declares no methods. Its sole purpose is to indicate that an object is a remote object. In general, sub-interfaces of java.rmi.Remote will declare remote methods, however. For example,
public interface Hello extends java.rmi.Remote {
public String sayHello();
}
public class HelloImpl extends UnicastRemoteServer implements Hello {
public String sayHello() {
return "Hello";
}
}
bye
knbaskar@usa.net
23 years ago
hi pankaj,
not the reply for u'r query.
but i want to know about the test u have taken.
where to go for it.how to proceed for it.
please help me
thank u
knbaskar@usa.net
23 years ago
hello friends
how can i display resultset in JTable.
can i pass resultset object directly in JTable.is it
possible
pl.help me
baskar
23 years ago