sqlException arises
is there any wrong in my code below..... sqlException arises in the insertThread method...?anyone knw the reason...?
[code]
public class DataBaseImpl
{
Connection con=null;
PreparedStatement ps=null;
Statement stmt=null;
public void createTable()
{
try
{
class.forName("com.mysql.jdbc.Driver").newInstance();
con=DriverManager.getConnection("jdbc:mysql://localhost/threadpool?user=root&password=");
stmt=con.createStatement();
String str="create table thread"+"(unique_Id varchar(100) primary key,"+"parent_id int,"+"data varchar(100))";
stmt.execute(str);
String str1="create table thread1"+"(unique_Id varchar(100) ,"+"child_id int)";
stmt.execute(str1);
}
catch(Exception e)
{
System.out.println(e);
}
}
public void insertThread(String unique,int id,String data)
{
try
{
ps=con.prepareStatement("insert into thread values(?,?,?)");
ps.setString(1,unique);
ps.setInt(2,id);
ps.setString(3,data);
ps.executeUpdate();
}
catch(Exception e)
{
System.out.println(e);
}
}
public void insertThread1(String unique,int cid)
{
try
{
ps=con.prepareStatement("insert into thread1 values(?,?)");
ps.setString(1,unique);
ps.setInt(2,cid);
ps.executeUpdate();
}
catch(Exception e)
{
System.out.println(e);
}
}
}
[code]

