Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

throwing SQLException : GeneralError

 
amarnath jha
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my programe is throwing SQLException GeneralError using oracle9i

//this is code

public void insertData(String name,int id,float price,int sales,float total)
{
try
{
//columns = statement.executeUpdate("insert into coffees values ("+name+","+id+","+price1+","+sales1+","+total1+")");
pStatement = connection.prepareStatement("insert into coffees values(?,?,?,?,?)");
pStatement.setString(1,name);
pStatement.setInt(1,id);
pStatement.setDouble(1,price);
pStatement.setInt(1,sales);
pStatement.setDouble(1,total);
pStatement.executeUpdate();
connection.commit();
System.out.println("no of rows inserted "+columns);
}
//catch block and other code
 
Arvind Sampath
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my programe is throwing SQLException GeneralError using oracle9i


Where? Which line no.? Post the Stack Trace for the exception
[ August 09, 2006: Message edited by: Arvind Sampath ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic