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 <code>onModuleLoad()</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 [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.