Exists the possibility to use dynamic SQL using the example attached ?
At least for the name table or the use whare clause ?

SAMPLE Class:
/ * SampleDataSource.java */
import java.sql.*;

public class SampleDataSource
{
private ResultSet resultSet =null;
private ResultSet resultSet1=null;
private Connection con=null;

private String url="jdbc:mysql://nlu/geststudio";
private String JDBCBridge = "com.mysql.jdbc.Driver";
private String sqlQuery = "select * from TARIFFARI";

public SampleDataSource()
{
try{
Class.forName(JDBCBridge);
con = DriverManager.getConnection(url, "root", "");
}catch( ClassNotFoundException e){
System.out.println("Controlla se il Driver installato");
e.printStackTrace();
}catch(SQLException e){
System.out.println("SQL Exception #"+e.getErrorCode()+" : "+e.getLocalizedMessage());
e.printStackTrace();
}
}

public ResultSet getResultSet() throws java.sql.SQLException
{
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIV E,
ResultSet.CONCUR_READ_ONLY);
resultSet = stmt.executeQuery(sqlQuery);
return resultSet;
}
}

SAMPLE JSP:
<%@ page import="com.crystaldecisions.report.web.viewer.*"% >
<%@ page import="com.crystaldecisions.report.htmlrender.*"% >
<%@ page import="com.crystaldecisions.reports.reportenginei nterface.*"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.repor tsource.*"%>
<%@ page import="com.crystaldecisions.sdk.occa.report.data. *"%>
<%@ page import="com.crystaldecisions.common.keycode.*"%>

<%@ page import="java.util.*"%>

<%
try {
IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();
String report = "report/Report2.rpt";

IReportSource reportSource = (IReportSource) rptSrcFactory.createReportSource(report, request.getLocale());
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setReportSource(reportSource);

viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);
viewer.dispose();

}catch(Exception e){
out.println("Errore " + e.getMessage());
}
%>