Sophia Oscario

Greenhorn
+ Follow
since May 14, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sophia Oscario

Here is my code :

Is there something wrong in it ?

------------------
** Science belongs to the world **
Sorry,
here is my code :
'<html>
'<head>
'<title>JDBC - MySQL</title>
'</head>
'<%@ page language="java" 'import="java.sql.*,com.codestudio.util.*" %><br /> '<body>
'
' ' ' ' ' ' '<% SQLManager myManager = SQLManager.getInstance(); Connection myConn = myManager.requestConnection(); Statement st = myConn.createStatement(); ResultSet rs = st.executeQuery("select * from employee"); if (rs != null) { while (rs.next()) { String eid = rs.getString("empid"); String name = rs.getString("lastname") + ", " + rs.getString("firstname"); String extention = rs.getString("extention"); %> ' ' ' ' ' <% } } st.close(); myManager.returnConnection(myConn); %> '
IDNameExtention
<%=eid %> <%=name %><%=extention %>

'

'</body>
'</html>

------------------
** Science belongs to the world **
I try to use Pool Manager 2.0 to handle database connection to MySQL from JSP.
But it returns an execption :
Exception Report:
javax.servlet.ServletException: javax/sql/ConnectionEventListener
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:442)
at org.apache.jsp.JDBCtest_jsp._jspService(JDBCtest_jsp.java:123)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
at java.lang.Thread.run(Thread.java:484)

Here's My code :
<html>
<head>
<title>JDBC - MySQL</title>
</head>
<%@ page language="java" import="java.sql.*,com.codestudio.util.*" %>
<body>

<% SQLManager myManager = SQLManager.getInstance(); Connection myConn = myManager.requestConnection(); Statement st = myConn.createStatement(); ResultSet rs = st.executeQuery("select * from employee"); if (rs != null) { while (rs.next()) { String eid = rs.getString("empid"); String name = rs.getString("lastname") + ", " + rs.getString("firstname"); String extention = rs.getString("extention"); %> <% } } st.close(); myManager.returnConnection(myConn); %>
ID Name Extention
<%=eid %> <%=name %> <%=extention %>


</body>
</html>
Please anybody can tell me what's wrong ...
Thanks

------------------
** Science belongs to the world **
I'm using Apache JServ 1.1.2 on my Win NT machine.
For the MySQL JDBC driver I use mm.mysql.jdbc-2.0pre5.
My question is how to configure the driver with the Apache Jserv ?
I try to use the driver on my servlet and it returns an error like this :
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver at org.apache.java.lang.AdaptiveClassLoader.loadClass(AdaptiveClassLoader.java:480) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) at JDBC.test.query(test.java:37) at JDBC.test.doGet(test.java:20) at javax.servlet.http.HttpServlet.service(HttpServlet.java:499) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:317) at org.apache.jserv.JServConnection.run(JServConnection.java:188) at java.lang.Thread.run(Thread.java:484)
I've set the CLASSPATH into the directory of the mm.mysql.jdbc. (according to the documentation), but it doesn't work.
Thanks in advance.

------------------
** Science belongs to the world **
hehehe sorry Mr Sheriff ....
I post that message with username CyberOsc accidentally.
I always use that username on others forum, so you know ...
hehehe
sorry again ...
------------------
** Science belongs to the world **
22 years ago
Hi...
Do you use Win 98 or Win 95 as your OS ?
I got the same problem like you when I use Win 98 on my computer.
But then the problem is gone when I change into Win 2000, I also try to test it on Win NT machine and there's no problem with it.
Some friends of mine also got it right this way.
Maybe this is not a good solution, just want you to know.
See ya

------------------
** Science belongs to the world **
22 years ago
I think JSP is more powerful than ASP.
JSP is more scalable dan reliable.
I used ASP for developing web application in my university, and I consider of changing it into JSP Servlet.

------------------
** Science belongs to the world **
22 years ago
Thanks a lot...
I'll check out those references ...
------------------
** Science belongs to the world **
hello all,
I'm really interested in XML, XSL and friends.
But I'm a newbie in it, just starting to learn it.
So, anybody can give me the right direction to start ?
Where can I find good references and tutorial for it ?
Thanks in advance
------------------
** Science belongs to the world **
I use Pool Manager to handle that ....
U can get it from http://www.codestudio.com/PoolMan/index.shtml

------------------
** Science belongs to the world **
22 years ago
i just change the method from get into post ...
and it works ....
------------------
** Science belongs to the world **
22 years ago
I wonder what is the purpose of using out.flush() ?
I found a flush method in ASP too that it is usefull when you set some header. If you set some header it should be set before any output made but if you use flush you can set the header anytime.
Is the purpose of flush method in servlet is the same ?
I try to put the header after I make some output to the client without using flush() in servlet, but no problem occurs ...
So actually what's the purpose of using flush method in servlet?
Thanks in advance ...

------------------
** Science belongs to the world **
22 years ago
I try to use Pool Manager 2.0 to handle database connection to MySQL from JSP.
But it returns an execption :
Exception Report:
javax.servlet.ServletException: javax/sql/ConnectionEventListener
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:442)
at org.apache.jsp.JDBCtest_jsp._jspService(JDBCtest_jsp.java:123)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
at java.lang.Thread.run(Thread.java:484)

Here's My code :
<html>
<head>
<title>JDBC - MySQL</title>
</head>
<%@ page language="java" import="java.sql.*,com.codestudio.util.*" %>
<body>
<font face="Trebuchet MS, Times">
<table border=1 cellpadding=0 cellspacing=0>
<tr>
<td align=center width=25>ID</td>
<td align=center width=150>Name</td>
<td align=center width=50>Extention</td>
</tr>
<%
SQLManager myManager = SQLManager.getInstance();
Connection myConn = myManager.requestConnection();

Statement st = myConn.createStatement();
ResultSet rs = st.executeQuery("select * from employee");
if (rs != null)
{
while (rs.next())
{
String eid = rs.getString("empid");
String name = rs.getString("lastname") + ", " + rs.getString("firstname");
String extention = rs.getString("extention");
%>
<tr>
<td align=center><%=eid %></td>
<td> <%=name %></td>
<td align=center><%=extention %></td>
</tr>
<%
}
}
st.close();
myManager.returnConnection(myConn);
%>
</table>
</font>
</body>
</html>
Please anybody can tell me what's wrong ...
Thanks
------------------
** Science belongs to the world **
22 years ago
I have Tomcat and Apache JServ running under the same machine and my URL for my app under Tomcat is : http://localhost:8080/examples/Cookies
the URL for my app under Apache JServ : http://localhost/dev/servlets/Cookies
I don't think that the domain is different, is it ?
So can those two servlet engine running together on the same machine and passing cookies variable between two of them ?
Thanks...
------------------
** Science belongs to the world **
22 years ago
I don't know about beta 3 ....
But I use Tomcat 4.0 beta 1 and there's no problem with it.
It does not need further configuration if you only want to see the home page in http://localhost:8080 as long as I know.
So I think maybe you can try another version
Try the beta 1 version under Win NT or Win 2000 (I have bad experience using it under Win 98, it crashed all the time).
See ya

------------------
** Science belongs to the world **
22 years ago