Yogesh MSharma

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

Recent posts by Yogesh MSharma

Hi
I dont Know how to use serizble class..
Would you make some change in my code
Hi I have written a RMI application where i want to fetch the REcord from the Other Machine.But i t is not Woring
Code is as given Below
It throws MarshelException
Code is
import java.rmi.*;
import java.sql.*;
public interface AddServerIntf2 extends Remote{
ResultSet disp(String name)throws RemoteException;
}
import java.rmi.*;
import java.rmi.server.*;
import java.sql.*;
public class AddServerImpl2 extends UnicastRemoteObject
implements AddServerIntf2{
public AddServerImpl2() throws RemoteException{
}
//void disp(String name,ResultSet rs1) throws RemoteException
public ResultSet disp(String name) throws RemoteException
{
String url="jdbc dbc:group";
ResultSet rs1=null;
Connection c;
PreparedStatement ps;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c=DriverManager.getConnection(url);
name="select * from "+name;
ps=c.prepareStatement(name);
return(rs1=ps.executeQuery());

}
catch(SQLException se){System.out.println("SQLException : "+se); }
catch(Exception e){System.out.println("Exception : "+e);}
return rs1;
}
}

import java.rmi.*;
import java.net.*;
public class AddServer2 {
public static void main(String ar[]){
try{
AddServerImpl2 a2=new AddServerImpl2();
Naming.rebind("AddServer2",a2);
}
catch(Exception e){System.out.println("Exception Caught : "+e);}
}
}import java.rmi.*;
import java.sql.*;
public class AddClient2{
public static void main(String ar[]){
try{
String URL="rmi://"+ar[0]+"/AddServer2";
AddServerIntf2 aa = (AddServerIntf2) Naming.lookup(URL);
System.out.println("Records from "+ar[1]);
System.out.println("Rollno Name");
ResultSet rs=aa.disp(ar[1]);
if(rs!=null)
{
while(rs.next()){
int i=rs.getInt("rollno");
String ss=rs.getString("name");
System.out.println(i+" "+ss);
}
}
}
catch(Exception e){System.out.println("Exception Caught : "+e);}
}
}
Hi I want to Know How To insert data fetch form Back end to the Grid or JTable i workd lot but not solovig the prob
Please helo out
Nima Your Code seen to be right
Just check out the progarm with the Application Insted of the Applet .if it works prob is with your Security Class
You have to check that with Secutiy One
Best if Luck
You Should Use the URL to Load The Class
Your Are missing Class form the Browser Path
Try To make HTML file in hte same directory .
Best Of LUCK
23 years ago
Hi Everyone
I am working with Beans Write Now and which are having many Bugs
From where Except java,sun.com sites i can download it..
With Full speed.
Hi EveryOne
I am having Problem in Closing The Frame Window Under Applet What is Wrong I have used the WindowAdapeter Class and also tried with WindowListenter.
What to Do with These