Re: Db Connectivity

2010-12-15 Thread Ashok

Hi,

 Asynchronous calls? What does this mean? I tried using threads. But,it gives
the error: ClassName cannot be found in the source package! If you can give some
example pages on Asynchronous calls, would be very helpful. Thanks in advance! 


-- 
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-tool...@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.



Re: Db Connectivity

2010-12-15 Thread David Chandler
http://code.google.com/webtoolkit/doc/latest/DevGuideServerCommunication.html

On Wed, Dec 15, 2010 at 6:39 PM, Ashok uashoksun...@gmail.com wrote:

 Hi,

  Asynchronous calls? What does this mean? I tried using threads. But,it gives
 the error: ClassName cannot be found in the source package! If you can give 
 some
 example pages on Asynchronous calls, would be very helpful. Thanks in advance!


 --
 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-tool...@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.





-- 
David Chandler
Developer Programs Engineer, Google Web Toolkit
http://googlewebtoolkit.blogspot.com/

-- 
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-tool...@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.



Re: Db Connectivity

2010-12-15 Thread John LaBanca
Thanks,
John LaBanca
jlaba...@google.com


On Wed, Dec 15, 2010 at 7:35 PM, David Chandler drfibona...@google.comwrote:


 http://code.google.com/webtoolkit/doc/latest/DevGuideServerCommunication.html

 On Wed, Dec 15, 2010 at 6:39 PM, Ashok uashoksun...@gmail.com wrote:
 
  Hi,
 
   Asynchronous calls? What does this mean? I tried using threads. But,it
 gives
  the error: ClassName cannot be found in the source package! If you can
 give some
  example pages on Asynchronous calls, would be very helpful. Thanks in
 advance!

GWT does not support threads... nor does JavaScript.  Asynchronous means
that you trigger an event to be completed some time in the future.  There
are two variations in GWT: asynchronous RPC calls to the server, and
timers/scheduled commands.  RPC calls send a request to the server, then at
some later point, the server responds and triggers a callback.

Timers/Scheduled Commands (see Scheduler) specify a method to run after some
timeout.  However, keep in mind that JavaScript is single threaded.  Lets
say you schedule a Timer for 1ms, then synchronously perform 100ms worth of
code execution.  Since JavaScript is single threaded, your Timer will not
fire for at least 100ms, even though you scheduled it for 1ms.  Its
asynchronous because the code in the Timer executes after the current
execution block.


 
 
  --
  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.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.
 
 



 --
 David Chandler
 Developer Programs Engineer, Google Web Toolkit
 http://googlewebtoolkit.blogspot.com/

 --
 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-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@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-tool...@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.



Re: Db Connectivity

2010-12-15 Thread David Chandler
Vindhya,

Getting back to the root of your original question, you can't connect
directly to a database with GWT because there's no way to connect to a
database directly from JavaScript. Instead, you create a GWT service
and implement it on the server, where you can connect to a database
using JDBC or any Java persistence framework. Here's an article on
using GWT with Hibernate that you will hopefully find helpful:

http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html

And this link explains how to communicate with the server using GWT-RPC:

http://code.google.com/webtoolkit/doc/latest/DevGuideServerCommunication.html

/dmc

On Thu, Dec 9, 2010 at 2:51 PM, Vindhya vin...@gmail.com wrote:
 Hello Friends,

 I am new to GWT and I am developing an application, - a form based
 one, to insert/delete/edit tuples in a set of tables.

 I am facing problems with the connectivity to the database.

 I kept getting an error:
 java.sql.Connection can not be found in source packages. Check the
 inheritance chain from your module; it may not be inheriting a
 required module or a module may not be adding its source path entries
 properly.

 The code I wrote is as follows:

 code
 package com.company.rulesengine.client;

 import java.sql.*;

 import com.google.gwt.core.client.EntryPoint;
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.TextBox;

 /**
  * Entry point classes define codeonModuleLoad()/code.
  */

 public class RulesEngineUI implements EntryPoint {

        public Connection conn= null;

        RulesEngineUI()
        {
                //establishing a database connection

            try
            {
              Class.forName(oracle.jdbc.driver.OracleDriver).newInstance();
              String url = url;
              conn = DriverManager.getConnection(url, SYSTEM, vindhya);
             // doTests();
                 System.out.println(DONE!);
              conn.close();
            }
            catch (Exception ex) {System.err.println(ex.getMessage());}

          }
        private Button clickMeButton;
        public void onModuleLoad()
        {

                RootPanel rootPanel = RootPanel.get();

                clickMeButton = new Button();
                rootPanel.add(clickMeButton, 232, 236);
                clickMeButton.setText(Insert);

                Label lblEmployeeId = new Label(Employee ID);
                rootPanel.add(lblEmployeeId, 30, 61);

                Label lblName = new Label(Employee Name);
                rootPanel.add(lblName, 26, 142);

                TextBox textBox = new TextBox();
                rootPanel.add(textBox, 233, 59);

                TextBox textBox_1 = new TextBox();
                rootPanel.add(textBox_1, 232, 142);
                clickMeButton.addClickHandler(new ClickHandler(){
                        public void onClick(ClickEvent event) {
                                Window.alert(Hello, GWT World!);
                        }
                });
        }
 }
 /code

 Any help in this regard will be well appreciated.

 Thank you,
 Vindhya

 --
 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-tool...@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.





-- 
David Chandler
Developer Programs Engineer, Google Web Toolkit
http://googlewebtoolkit.blogspot.com/

-- 
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-tool...@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.



Re: Db Connectivity

2010-12-10 Thread Didier Durand
Hi, the exact list of classes that you can use is here:
http://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html

Be careful though: some methods are supported and some not, the list
above details it.

regards
didier

On Dec 10, 6:39 am, aditya sanas 007aditya.b...@gmail.com wrote:
 Hi,

 The code you write in java gets converted into javascript this is what GWT
 does so GWT works on client side
 so there is some restriction on usage of classes and packages that u refer
 in GWT code just like *java.sql. or java.io*
 *these packages are not available on client side*
 So to use these classes,GWT has provided server side where you can access
 these classes so make ur connection on the server side do processing and
 send result back to client.
 Async calls would be helpful in this case.

 --
 Aditya

 On Fri, Dec 10, 2010 at 1:21 AM, Vindhya vin...@gmail.com wrote:
  Hello Friends,

  I am new to GWT and I am developing an application, - a form based
  one, to insert/delete/edit tuples in a set of tables.

  I am facing problems with the connectivity to the database.

  I kept getting an error:
  java.sql.Connection can not be found in source packages. Check the
  inheritance chain from your module; it may not be inheriting a
  required module or a module may not be adding its source path entries
  properly.

  The code I wrote is as follows:

  code
  package com.company.rulesengine.client;

  import java.sql.*;

  import com.google.gwt.core.client.EntryPoint;
  import com.google.gwt.event.dom.client.ClickEvent;
  import com.google.gwt.event.dom.client.ClickHandler;
  import com.google.gwt.user.client.Window;
  import com.google.gwt.user.client.ui.Button;
  import com.google.gwt.user.client.ui.RootPanel;
  import com.google.gwt.user.client.ui.Label;
  import com.google.gwt.user.client.ui.TextBox;

  /**
   * Entry point classes define codeonModuleLoad()/code.
   */

  public class RulesEngineUI implements EntryPoint {

         public Connection conn= null;

         RulesEngineUI()
         {
                 //establishing a database connection

             try
             {

   Class.forName(oracle.jdbc.driver.OracleDriver).newInstance();
               String url = url;
               conn = DriverManager.getConnection(url, SYSTEM, vindhya);
              // doTests();
                  System.out.println(DONE!);
               conn.close();
             }
             catch (Exception ex) {System.err.println(ex.getMessage());}

           }
         private Button clickMeButton;
         public void onModuleLoad()
         {

                 RootPanel rootPanel = RootPanel.get();

                 clickMeButton = new Button();
                 rootPanel.add(clickMeButton, 232, 236);
                 clickMeButton.setText(Insert);

                 Label lblEmployeeId = new Label(Employee ID);
                 rootPanel.add(lblEmployeeId, 30, 61);

                 Label lblName = new Label(Employee Name);
                 rootPanel.add(lblName, 26, 142);

                 TextBox textBox = new TextBox();
                 rootPanel.add(textBox, 233, 59);

                 TextBox textBox_1 = new TextBox();
                 rootPanel.add(textBox_1, 232, 142);
                 clickMeButton.addClickHandler(new ClickHandler(){
                         public void onClick(ClickEvent event) {
                                 Window.alert(Hello, GWT World!);
                         }
                 });
         }
  }
  /code

  Any help in this regard will be well appreciated.

  Thank you,
  Vindhya

  --
  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-tool...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@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-tool...@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.



Db Connectivity

2010-12-09 Thread Vindhya
Hello Friends,

I am new to GWT and I am developing an application, - a form based
one, to insert/delete/edit tuples in a set of tables.

I am facing problems with the connectivity to the database.

I kept getting an error:
java.sql.Connection can not be found in source packages. Check the
inheritance chain from your module; it may not be inheriting a
required module or a module may not be adding its source path entries
properly.

The code I wrote is as follows:

code
package com.company.rulesengine.client;

import java.sql.*;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;

/**
 * Entry point classes define codeonModuleLoad()/code.
 */

public class RulesEngineUI implements EntryPoint {

public Connection conn= null;

RulesEngineUI()
{
//establishing a database connection

try
{
  Class.forName(oracle.jdbc.driver.OracleDriver).newInstance();
  String url = url;
  conn = DriverManager.getConnection(url, SYSTEM, vindhya);
 // doTests();
 System.out.println(DONE!);
  conn.close();
}
catch (Exception ex) {System.err.println(ex.getMessage());}

  }
private Button clickMeButton;
public void onModuleLoad()
{

RootPanel rootPanel = RootPanel.get();

clickMeButton = new Button();
rootPanel.add(clickMeButton, 232, 236);
clickMeButton.setText(Insert);

Label lblEmployeeId = new Label(Employee ID);
rootPanel.add(lblEmployeeId, 30, 61);

Label lblName = new Label(Employee Name);
rootPanel.add(lblName, 26, 142);

TextBox textBox = new TextBox();
rootPanel.add(textBox, 233, 59);

TextBox textBox_1 = new TextBox();
rootPanel.add(textBox_1, 232, 142);
clickMeButton.addClickHandler(new ClickHandler(){
public void onClick(ClickEvent event) {
Window.alert(Hello, GWT World!);
}
});
}
}
/code

Any help in this regard will be well appreciated.

Thank you,
Vindhya

-- 
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-tool...@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.



Re: Db Connectivity

2010-12-09 Thread aditya sanas
Hi,

The code you write in java gets converted into javascript this is what GWT
does so GWT works on client side
so there is some restriction on usage of classes and packages that u refer
in GWT code just like *java.sql. or java.io*
*these packages are not available on client side*
So to use these classes,GWT has provided server side where you can access
these classes so make ur connection on the server side do processing and
send result back to client.
Async calls would be helpful in this case.


--
Aditya


On Fri, Dec 10, 2010 at 1:21 AM, Vindhya vin...@gmail.com wrote:

 Hello Friends,

 I am new to GWT and I am developing an application, - a form based
 one, to insert/delete/edit tuples in a set of tables.

 I am facing problems with the connectivity to the database.

 I kept getting an error:
 java.sql.Connection can not be found in source packages. Check the
 inheritance chain from your module; it may not be inheriting a
 required module or a module may not be adding its source path entries
 properly.

 The code I wrote is as follows:

 code
 package com.company.rulesengine.client;

 import java.sql.*;

 import com.google.gwt.core.client.EntryPoint;
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.TextBox;

 /**
  * Entry point classes define codeonModuleLoad()/code.
  */

 public class RulesEngineUI implements EntryPoint {

public Connection conn= null;

RulesEngineUI()
{
//establishing a database connection

try
{

  Class.forName(oracle.jdbc.driver.OracleDriver).newInstance();
  String url = url;
  conn = DriverManager.getConnection(url, SYSTEM, vindhya);
 // doTests();
 System.out.println(DONE!);
  conn.close();
}
catch (Exception ex) {System.err.println(ex.getMessage());}

  }
private Button clickMeButton;
public void onModuleLoad()
{

RootPanel rootPanel = RootPanel.get();

clickMeButton = new Button();
rootPanel.add(clickMeButton, 232, 236);
clickMeButton.setText(Insert);

Label lblEmployeeId = new Label(Employee ID);
rootPanel.add(lblEmployeeId, 30, 61);

Label lblName = new Label(Employee Name);
rootPanel.add(lblName, 26, 142);

TextBox textBox = new TextBox();
rootPanel.add(textBox, 233, 59);

TextBox textBox_1 = new TextBox();
rootPanel.add(textBox_1, 232, 142);
clickMeButton.addClickHandler(new ClickHandler(){
public void onClick(ClickEvent event) {
Window.alert(Hello, GWT World!);
}
});
}
 }
 /code

 Any help in this regard will be well appreciated.

 Thank you,
 Vindhya

 --
 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-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@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-tool...@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.