Two Laptop Bag*
The moose likes JDBC and the fly likes throwing SQLException : GeneralError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "throwing SQLException : GeneralError" Watch "throwing SQLException : GeneralError" New topic
Author

throwing SQLException : GeneralError

amarnath jha
Greenhorn

Joined: Aug 07, 2006
Posts: 18
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

Joined: May 11, 2005
Posts: 144
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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: throwing SQLException : GeneralError