开发者

Problems Deploying GWT Project

trying to deploy gwt application with RPC service over tomcat in fedora, but its not connecting to the database while logging in. Although the same is working o开发者_如何学Pythonver tomcat in windows. Do we have to do something different in fedora? Problem is only with connection with the database, as while calling RPC service, no object is returned?


Is your JDBC driver working properly ? If not then run as root,

yum install mysql-connector-java

Also try testing with a simple java program.

import java.sql.*;

public class Connect
{
    public static void main (String[] args)
    {
        Connection conn = null;

        try
        {
            String userName = "testuser";
            String password = "testpass";
            String url = "jdbc:mysql://localhost/test";
            Class.forName ("com.mysql.jdbc.Driver").newInstance ();
            conn = DriverManager.getConnection (url, userName, password);
            System.out.println ("Database connection established");
        }
        catch (Exception e)
        {
            System.err.println ("Cannot connect to database server");
        }
        finally
        {
            if (conn != null)
            {
                try
                {
                    conn.close ();
                    System.out.println ("Database connection terminated");
                }
                catch (Exception e) { /* ignore close errors */ }
            }
        }
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜