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]

[1540 byte] By [83Krisha] at [2007-11-27 7:53:01]
# 1
Your code is poorly formatted. Perhaps thats why I didnt even bother reading through it. You are lucky I found the time to tell you this.
Jamwaa at 2007-7-12 19:34:16 > top of Java-index,Java Essentials,Java Programming...