I cannot connect to database in development mode/hosted mode. my environment: eclipse hellio 3.6, fedora 12, mysql, gwt2.2.
I could successfully connect to mysql using JSP using same environment. On Tue, Mar 15, 2011 at 1:33 AM, Juan Pablo Gardella < gardellajuanpa...@gmail.com> wrote: > This help? > http://stackoverflow.com/questions/2297356/mysqlnontransientconnectionexception-in-jdbc-program-at-run-time > > > <http://stackoverflow.com/questions/2297356/mysqlnontransientconnectionexception-in-jdbc-program-at-run-time> > Juan > > > 2011/3/14 Dilip Rathod <rathod...@gmail.com> > >> I can gwt-rpc communication with server sucessfully. >> but when i want to interact with mysql I get following error >> >> com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: >> Could not create connection to database server. >> >> I added mysql connector to WEB-Inf/lib dierctory >> >> following is my code that tries to connect to data base >> >> public String login(String usr,String pwd) >> { >> Connection conn = null; >> String url = "jdbc:mysql://localhost:3306/ >> SeekwadiDataBank"; >> String db = "SeekwadiDataBank"; >> String driver = "com.mysql.jdbc.Driver"; >> String user = "user"; >> String pass = "user"; >> String connerr=null; >> try >> { >> connerr="Connecting ...."; >> Class.forName(driver).newInstance(); >> connerr+="Still Working...."; >> //Class.forName("com.mysql.jdbc.Driver"); >> conn = DriverManager.getConnection(url, user, pass); >> connerr="Conncted...."; >> } catch (Exception e) { >> // TODO: handle exception >> connerr+=e.toString(); >> >> } >> return connerr; >> } >> >> >> i cannot give full stack trace becuse it is not available at client >> side >> >> client side code taht communicate asynchronoulsy to server is >> >> Hyperlink login = new Hyperlink("Login", "Login"); >> login.addClickListener(new ClickListener() { >> public void onClick(Widget widget) >> { >> hp.clear(); >> final TextBox usr=new TextBox(); >> final PasswordTextBox pwd=new PasswordTextBox(); >> >> Button loginb=new Button("Login"); >> loginb.addClickHandler(new ClickHandler() >> { >> public void onClick(ClickEvent event) >> { //Window.alert("Starts"); >> AsyncCallback callback = new AsyncCallback() >> { >> >> public void onSuccess(Object result) >> { >> if(((String) result).equals("Ok")) >> { Window.alert("Login >> Status:"+result.toString()); >> usr.setText(""); pwd.setText(""); } >> else { Window.alert("Login >> Status:"+result.toString()); usr.setText(""); pwd.setText(""); } >> } >> public void onFailure(Throwable caught) >> { Window.alert(caught.getMessage()); } >> }; >> no.login(usr.getText(),pwd.getText(), callback); >> //Window.alert("Ends"); >> } >> >> }); >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Web Toolkit" group. >> To post to this group, send email to google-web-toolkit@googlegroups.com. >> To unsubscribe from this group, send email to >> google-web-toolkit+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/google-web-toolkit?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-toolkit@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.