I am using Spark with Scala and trying to get data from a database using JdbcRDD. 

```
val rdd = new JdbcRDD(sparkContext,
    driverFactory,
    testQuery,
    rangeMinValue.get,
    rangeMaxValue.get,
    partitionCount,
    rowMapper)
    .persist(StorageLevel.MEMORY_AND_DISK)    

```

Within the query there are no ? values to set (since the query is quite long I am not putting it here.) So I get an error saying that,

*java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).*

I have no idea what the problem is. Can someone suggest any kind of solution ?