! The following figure shows the upload (img.ask.csdn.netupload201605301464607016_994959.png) error when calling the stored procedure in Java. the stored procedure has two int parameters, which can be run in the database. the running result is java. SQL. SQLException: Parameterindexoutofrange (0 & lt; 1 ). the code is as follows. I don't know how to change it. ask a netizen to help publicArrayListgetzhdltj (StringTime, StringD mysqljava stored procedure
An error is reported when Java calls a stored procedure. the stored procedure has two int-type parameters and can run the stored procedure in the database. the running result is as follows: java. SQL. SQLException: Parameter index out of range (0 <1 ).
The code is as follows. I don't know how to change it. please help me.
Public ArrayList getzhdltj (String Time, String Dzbm)
{
// Define some variables
ResultSet rs = null;
Connection ct = null;
PreparedStatement csmt = null;
Statement ps = null;
ArrayList al = new ArrayList ();
Try
{
Ct = (new ConnectDB (). ConnDB ();
Int Dzbmint = Integer. parseInt (Dzbm );
Int Timeint = Integer. parseInt (Time );
// Ct. setAutoCommit (false );
Csmt = ct. prepareCall ("{PRO _ integrated power statistics (IN_YEAR, IN_STATIONID )}");
Csmt. setInt (0, Timeint );
Csmt. setInt (1, Dzbmint );
Csmt.exe cute (); ct. commit (); rs1_csmt.exe cuteQuery (); while (rs. next () {Wnbqgl nbqgl = new Wnbqgl (); // nbqgl. setMaxdl (rs. getDouble (2);/* monthly scheduled power generation */nbqgl. setYjfdl (rs. getDouble (1); nbqgl. setEjfdl (rs. getDouble (2); nbqgl. setSjfdl (rs. getDouble (3); nbqgl. setSijfdl (rs. getDouble (4); nbqgl. setWjfdl (rs. getDouble (5); nbqgl. setLjfdl (rs. getDouble (6); nbqgl. setQjfdl (rs. getDouble (7); nbqgl. setBjfdl (rs. getDouble (8); nbqgl. setJjfdl (rs. getDouble (9); nbqgl. setShijfdl (rs. getDouble (10); nbqgl. setSyjfdl (rs. getDouble (11); nbqgl. setSejfdl (rs. getDouble (12 ));