• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in CallableStatement

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the following code---------
import java.sql.*;
public class MyDBTest
{
Connection myConn = null;
MyDBTest()
{
try {
Class.forName("sun.jbc.odbc.JdbcOdbcDriver");
myConn = DriverManager.getConnection("jdbc dbc:CatalogSalesSystem","sa","");
}
catch(ClassNotFoundException exp){}
catch(SQLException exp){}
}
public void processMe(int i, String str, float sal){
try{
System.out.println("*");
CallableStatement callStat = myConn.prepareCall(" {call myProcedure(?,?,?)}");
System.out.println("*);
callStat.setInt(1 , i);
callStat.setString(2 , str);
callStat.setFloat(3 , sal);
int in = callStat.executeUpdate();
}
catch(SQLException exp){
System.out.println(exp);
}
}
public static void main(String[] args)
{
MyDBTest myDB = new MyDBTest();
myDB.processMe(22,"Soni",2000);
}
}
CREATE PROCEDURE myProcedure @empId int, @empName varchar(20), @empSal float AS
begin transaction
insert into tabCheck(EmpId,EmpName,EmpSalary) VALUES (@empID,@empName,@empSal)
commit

return
I am geting
*
java.lang.NullPointerException
Would anybody help me in finding the problem???
Thanks in advance
 
Smita Tyagi
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everybody,
Don't waste your time I have found the solution it was typo mistake on my part.
reply
    Bookmark Topic Watch Topic
  • New Topic