/**
* db conn
*
* Make sure you add a reference library (external jar in build path) JDBC
Connector -
* You will see I put it in /opt/gwt-linux/mysql-connector-java-5.0.8-bin.jar
*
* @return Connection
*/
private Connection getConn() {
Connection conn = null;
String url = "jdbc:mysql://192.168.12.81:3306/";
String db = "hostdb";
String driver = "com.mysql.jdbc.Driver";
String user = "";
String pass = "";
try {
Class.forName(driver).newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
try {
conn = DriverManager.getConnection(url+db, user, pass);
} catch (SQLException e) {
System.err.println("Mysql Connection Error: ");
e.printStackTrace();
}
return conn;
}
Here are some MySql wiki notes I put together:
http://code.google.com/p/gwt-examples/wiki/project_MySQLConn
Hope that helps,
Brandon Donnelson
http://gwt-examples.googlecode.com
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/abCrPHWVXhYJ.
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.