Hybride Posted April 27, 2009 Share Posted April 27, 2009 I've been trying to retrieve a query using ASP through Java on an Oracle db, to no avail. With quotes, the query comes up blank; without quotes, the entire query is used. If I rename "symbol" to anything but "symbol", I get an error ("invalid identifier"). It's running on localhost. Any help greatly appreciate. :] <body> <%@ page import="java.sql.*" %> <p align="center"><h1>TRANSACTION SYSTEM</h1> <form action="member.jsp" method=POST> SECURITY NAME (4 Symbols): <input name=symbol type=text maxlength=4 width=20> <input type="submit" value="submit"> <% // try { //Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); Class.forName("oracle.jdbc.driver.OracleDriver"); java.sql.Connection conn; conn = DriverManager.getConnection( "jdbc:oracle:thin:@oracle.cs.luc.edu:1521:orcl","xxx","xxxx"); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("select * from security WHERE symbol='symbol'"); %> <table border=2 cellpadding=5 cellspacing=5> <tr> <th>SYMBOL</th> <th>CNAME</th> <th>FNAME</th> </tr> <% while (rs.next()) { String symbol = rs.getString(1); String cname = rs.getString(2); /* String mid = rs.getString(1); String lname = rs.getString(3); String fname = rs.getString(4); */ %> <tr> <td><%= symbol%></td> <td><%= cname%></td> <td><%= cname%></td> </tr> <% } rs.close(); stmt.close(); conn.close(); %> Link to comment https://forums.phpfreaks.com/topic/155850-asp-java-oracle/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.