Hi,
I am getting this error:
[ERROR] Line 11: No source code is available for type
java.sql.SQLException; did you forget to inherit a required module?
when trying to check if an entered SSN is a duplicate via RPC. Here is
my RPC implementation:
package com.cadao.server;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import com.cadao.client.RegistrationService;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
public class RegistrationServiceImpl extends RemoteServiceServlet
implements RegistrationService
{
private static final long serialVersionUID = 1L;
public boolean isDuplicateSsn(String ssn) throws SQLException
{
String sql = "SELECT Ssn " +
"FROM User U JOIN Mem M ON U.UserId =
M.UserId " +
"WHERE Ssn = '" + ssn + "'";
CadaoDb cadaoDb = new CadaoDb();
Connection connection = cadaoDb.getConnection();
Statement select = connection.createStatement();
ResultSet resultSet = select.executeQuery(sql);
resultSet.last();
if(resultSet.getRow() > 0)
return true;
return false;
}
}
============================================
package com.cadao.server;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
public abstract class Db
{
private String driver = "com.mysql.jdbc.Driver";
/**
* Constructor
*/
public Db()
{ }
protected abstract String getUrl();
protected abstract String getDb();
protected abstract String getUser();
protected abstract String getPassword();
public final Connection getConnection()
{
String url = getUrl();
String db = getDb();
String user = getUser();
String password = getPassword();
Connection connection = null;
try
{
Class.forName(driver).newInstance();
connection = DriverManager.getConnection(url + db,
user, password);
}
catch(Exception e)
{
System.err.println("Mysql Connection Error: ");
e.printStackTrace();
}
return connection;
}
protected static int getResultSetSize(ResultSet resultSet)
{
int size = -1;
try
{
resultSet.last();
size = resultSet.getRow();
resultSet.beforeFirst();
}
catch(SQLException e)
{ return size; }
return size;
}
}
======================================
I got this code from here:
http://gwt-examples.googlecode.com/svn/trunk/gwt-test-MySQLConn/src/com/tribling/gwt/test/mysqlconn/server/
Could somebody help me see what's missing? Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---