I'm aware this is off topic, but I couldn't' find the answer anywhere and this list
has always helped me. I'm trying to run a wildcard search using a prepared statement,
but I'm having zero luck. I've include the statement below. Any help is greatly
appreciated. Note, the code below doesn't include a wildcard because all my attempt
to use a "%" has failed.
<%
Class.forName("macromedia.jdbc.MacromediaDriver");
java.sql.Connection connection =
java.sql.DriverManager.getConnection("jdbc:macromedia:sqlserver://127.0.0.1:1433;databaseName=name;user=user;password=pass");
String query = "SELECT * FROM events WHERE name like ?";
java.sql.PreparedStatement statement = connection.prepareStatement(query);
statement.setString(1,request.getParameter("name"));
java.sql.ResultSet RS = statement.executeQuery();
%>
If it matters anything, I'm running this on CFMX.