PDA

View Full Version : help.....



mysterious_man
12-22-2006, 01:50 AM
hi everyone,

i want to ask to you guys tat can i apply this jsp code (code 1) into the default "SampleDashboard.jsp" file?
tat code 1 is referred from the this url....
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2162&lngWId=2

///////////////////////////////////////////////////////////////////////

<!-- Code 1 -->

<%@ page import="java.sql.*" %>
<%
String connectionURL = "jdbc:mysql://localhost:3306/mydatabase?user=;password=";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
%>

<html><body>

<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "", "");
statement = connection.createStatement();
rs = statement.executeQuery("SELECT * FROM mytable");

while (rs.next()) {
out.println(rs.getString("myfield")+"<br>");
}

rs.close();
%>

</body></html>
///////////////////////////////////////////////////////////////////////

now, the problem is the default "SampleDashboard.jsp" is using the parameters.setParameter() to set the variable & call that variable to xml file then use that variable to retrieve data in xaction.. can anyone show me the way to select the database from mysql without involving the xml and xaction but only involves jsp?

below is the attachment output i had done for this chart.....
i want to select the values from the mysql database for the dial... but the dial do not show the appropriate output


can anyone help me to solve this?
thx...

mysterious_man