Hi,
I am using
JBoss4.0.1 server
MySQL 4.0.23 database
& MySQL connector/J 3.1.6 driver
for an application. Here in a
JSP file I've used the following code fragment:
------------------------------------------------------------
<%
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql:///Phonebook","root","");
Statement stmt = con.createStatement();
boolean exRes = stmt.execute("CREATE TABLE Phonebook (name VARCHAR(60),phoneNumber VARCHAR(15))");
out.println("Table Created");
}
catch(Exception e)
{
out.println("SORRY For the error");
}
%>
-------------------------------------------------------------
though the table is not created it is giving the output:
SORRY For the error
-------------------------------------------------------------
But the same
jdbc connection working fine from a simple .java file...
Is there any anything else required for jdbc connection?
please help.