• Post Reply Bookmark Topic Watch Topic
  • New Topic

Invoking a SQL and stored procedure

Kingsley Mullers
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, i've written the following code and feed i've left out something , i just need to put it together correctly with a solid logic..can you help me put it nicely...i'm sending short messages (from s stored procedure)to the results generated from the SQL statement...thanking advance..

package co.za.sarstces.payphone;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.Connection;
import org.apache.log4j.Logger;
public class GeographicalArea

private static StringBuffer sqlString = null;
private static String NumberList;
private Connection connobj;

public GeographicalArea(){ }

// public NumberList getAgentrange(Connection cn,String rangebegin, String rangeend)

// declare the resultset
PreparedStatement pstmt=null;
ResultSet rs =null;

sqlString = new StringBuffer();
sqlString.append(" select distinct ccp01_contact_msisdn ");
sqlString.append(" from so_cpp.tcp08_payphone_histories b , SO_CPP.TCP01_OWNER_DETAILS c ");
sqlString.append(" where b.ccp08_owner_id = c.ccp01_owner_id ");
sqlString.append(" and b.ccp08_msisdn between ? ");
sqlString.append(" and ? ");
sqlString.append(" and nvl(ccp01_contact_msisdn , 0) > 0");
sqlString.append(" and nvl(ccp08_date_ceased,sysdate+1) > sysdate ");

// pstmt = cn.prepareStatement(sqlString);
// rs = pstmt.executeQuery();

// return rs;


public String sendMSISDN(Connection connobj, int contactNumber, String messageContent)

GeographicalArea area = new GeographicalArea();
NumberRange getAgentsrange = new NumberRange();
// getAgentsrange = area.getAgentrange();
CallableStatement csmt = null;
// for(int i = 0; i < msisdnrange.size(); i++)

csmt = connobj.prepareCall("{? = call so_util.wdpk_sms_messages.insert_sms(?,?,?,?,?,?,?,?,?,?,?,?,?) }");
//input parameters
// csmt.setInt(1, msisdnrange.[i]);
// csmt.registerOutParameter(11,NUMBER);;
// csmt.registerOutParameters(12,VARCHAR);

ResultSet rs =csmt.executeQuery();

} catch (Exception e)

return null;


She still doesn't approve of my superhero lifestyle. Or this shameless plug:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!