hi
iam very new to this google apps
i know how to deploy application.
can you please guide me how to do jdbc part using mysql .
i want to create database ,tables and i also want to do CURD
operation.
its very urgent.
i add this code to tomact
grant codeBase "file:${catalina.home}/webapps/-" {
permission java.net.SocketPermission "192.168.12.81:3306",
"connect";
};
this is my code:
Connection conn = null;
String url = "jdbc:mysql://192.168.12.81:3306/";
String db = "First";
String driver = "com.mysql.jdbc.Driver";
String user = "";
String pass = "";
try {
Class.forName(driver).newInstance();
} catch (InstantiationException e) {
out.println(e);
e.printStackTrace();
} catch (IllegalAccessException e) {
out.println(e);
e.printStackTrace();
} catch (ClassNotFoundException e) {
out.println(e);
e.printStackTrace();
}
try {
conn = DriverManager.getConnection(url+db, user, pass);
PreparedStatement pst=conn.prepareStatement("create table
testbhagya(name varchar(20))");
int i=pst.executeUpdate();
out.println("table created"+i);
PreparedStatement pst1=conn.prepareStatement("insert into
testbhagya values('laxmi')");
int j=pst1.executeUpdate();
out.println("insert"+i);
PreparedStatement pst2=conn.prepareStatement("select *
from tab");
ResultSet rs=pst2.executeQuery();
while(rs.next())
{
out.println(rs.getString(1));
}
} catch (Exception e) {
out.println(e);
System.err.println("Mysql Connection Error: ");
e.printStackTrace();
}
i am getting error.
what is wrong.
Thanks and Regards
Bhagya..
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" 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-appengine-java?hl=en.