Hello,
I have a similar kind of problem and here is my code, please help me with this and if you find a problem in my code then please guide me with the correct.
Code:
Public class ndmnser extends UnicastRemoteObject implements RemoteLinkman {
private static Final long serialVersionUID = 1L;
Public ndmnser() throws RemoteException {
}
Public UserNodeData getRootNode() throws RemoteException
{
Connection c = Link.getSQLcon().getConnection();
Statement st;
/ / Get a Statement object
try {
st = c.createStatement();
String u = "laurent";
String q = "SELECT * FROM u WHERE username = '" + User + "'";
ResultSet rs = st.executeQuery(q);
System.err.System.out.println(q);
if (rs.next()) {
UserNodeData n = new UserNodeData (rs.getString("firstname") , rs.getString("name"), Rs.getString("username"), rs.getLong("id"));
System.out.System.out.println("what is returned by getrootnode" + N);
return n;
}
} catch (Exception e)
{
e.printStackTrace();
}
System.err.System.out.println("return null");
return null;
}
Bookmarks