session timeout
Hello all ! I'm using a Tomcat-based authentication. How do you do to set the session timeout time ? I mean, the time of inactivity after which one the user must re-login. I'm using Tomcat 5.5. Regards, Pierre -- Mon horizon était désormais les pétales courbés, Ma nouvelle demeure resplendissait de flèches d'herbes folles Et d'oreillers de pollens odorants. (Naïmah, le philosophe Fémereif)
Unconnected sockets not implemented
Hi all, I have tomcat ssl configured ant tried to access it with a jsse client but i get the following error: [java] Exception in thread main org.apache.axis2.AxisFault: Unconnected s ockets not implemented; nested exception is: [java] java.net.SocketException: Unconnected sockets not implemented; n any idea? Thanks, Nencho
Re: session timeout
Hello Pierre, Try setting this in your tomcat /conf/web.xml. It should work for all the contexts. session-config session-timeout60/session-timout /session-config (the time is specified in mins) Or you can set this in a specific webapp web.xml so that it would be the only one with a 60 minutes session timeout. Olivier Le 28/05/07, Pierre Goupil [EMAIL PROTECTED] a écrit : Hello all ! I'm using a Tomcat-based authentication. How do you do to set the session timeout time ? I mean, the time of inactivity after which one the user must re-login. I'm using Tomcat 5.5. Regards, Pierre -- Mon horizon était désormais les pétales courbés, Ma nouvelle demeure resplendissait de flèches d'herbes folles Et d'oreillers de pollens odorants. (Naïmah, le philosophe Fémereif)
Re: session timeout
There is a spelling mistake in what i wrote : session-config session-timeout60/session-timeout /session-config This should work better i guess ;) 2007/5/28, Olivier Bouchereau [EMAIL PROTECTED]: Hello Pierre, Try setting this in your tomcat /conf/web.xml. It should work for all the contexts. session-config session-timeout60/session-timout /session-config (the time is specified in mins) Or you can set this in a specific webapp web.xml so that it would be the only one with a 60 minutes session timeout. Olivier Le 28/05/07, Pierre Goupil [EMAIL PROTECTED] a écrit : Hello all ! I'm using a Tomcat-based authentication. How do you do to set the session timeout time ? I mean, the time of inactivity after which one the user must re-login. I'm using Tomcat 5.5. Regards, Pierre -- Mon horizon était désormais les pétales courbés, Ma nouvelle demeure resplendissait de flèches d'herbes folles Et d'oreillers de pollens odorants. (Naïmah, le philosophe Fémereif)
Is there opportunity to replicate configuration files for nodes of cluster?
Hello list Is there opportunity to replicate configuration files for nodes of cluster? Thx - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session timeout
Quoting Pierre Goupil [EMAIL PROTECTED]: Hello all ! I'm using a Tomcat-based authentication. How do you do to set the session timeout time ? I mean, the time of inactivity after which one the user must re-login. You can set the http session-time into the Web.xml file of you webapp: session-config session-timeout Your_value_in_minutes /session-timeout /session-config you can set it programmatically to (have a look to the j2ee javadoc) Goupil, c'est un nom prédestiné pour l'informatique ca ;-) Ce message a ete envoye par le serveur IMP de l'EMA. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat Native Library Breaks SSL
I am working with Windows XP Tomcat 5.5.23 http://tomcat.heanet.ie/native/1.1.10/binaries/win32/ I followed the openssl instructions at http://www.galatea.com/flashguides/tomcat-ssl-5-unix to setup my ssl. When I start tomcat and try to connect to localhost:8443 the browser sits there loading for a long time. After a couple minutes of waiting the browser stops and says The connection was interrupted The connection to 127.0.0.1:8443 was interrupted while the page was loading I finally removed the tcnative-1.dll from my windows/system32 directory and restarted tomcat. The ssl works properly now. I probably spent a couple days debugging this problem. Anyone know why the native library stops ssl from working? Also I did adjust the debug=0 to debug=5 but didn't receive any more detailed output. My conf/server.xml looks like: Connector port=8443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false sslProtocol=TLS keystoreType=PKCS12 keystoreFile=mycert.p12 keystorePass=changeit/ I tried changing my ssl connector xml to ajp syntax like: Connector port=8443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true SSLEngine=on SSLCertificateFile=${catalina.base}/conf/localhost.crt SSLCertificateKeyFile=${catalina.base}/conf/localhost.key / but I renamed my mycert.pem to localhost.crt and mykey.pem to localhost.key - the files created from the www.galatea.com instructions - but it resulted in the same browser loading till the problem loading page message. Thanks for any advice. MG Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. http://tv.yahoo.com/ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is there opportunity to replicate configuration files for nodes of cluster?
nope, not at this time Filip Corobitsyn Roman wrote: Hello list Is there opportunity to replicate configuration files for nodes of cluster? Thx - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Native Library Breaks SSL
From: Mike Grandmaison [mailto:[EMAIL PROTECTED] Subject: Tomcat Native Library Breaks SSL Windows XP Tomcat 5.5.23 http://tomcat.heanet.ie/native/1.1.10/binaries/win32/ I followed the openssl instructions at http://www.galatea.com/flashguides/tomcat-ssl-5-unix to setup my ssl. You might try following the real documentation: http://tomcat.apache.org/tomcat-5.5-doc/apr.html#HTTPS - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Admin config
Hi all I've a very very newbie on tomcat (first day I try to configure tomcat)... I've install from ports (FreeBSD) the tomcat 5.5 (need by my web-applications). The applications I need to run is configured by admin tomcat. Well for this I've install admin module and it seem everything working (I can acces the admin page etc.) My problem is I can go the context of my application through the admin module, but when I make any changes in the config of my webapps, this changes are loose after reboot of the tomcat server. I've change the owner of TOMCAT_HOME/conf to the uid run tomcat, but nothing work. Any help ? Regards. -- Albert SHIH Observatoire de Paris Meudon SIO batiment 15 Téléphone : 01 45 07 76 26 Heure local/Local time: Lun 28 mai 2007 16:59:53 CEST - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reload keystore
If I add a new client-certificate to the keystore, how can I force Tomcat to reload the keystore without restarting tomcat? Can I set a timer to say tomcat has to reload the keystore every xx-seconds? Or is there any way to program this? Thank you for your help Sam - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Native Library Breaks SSL
Also, use tcnative-1.1.9. I also encountered problems with 1.1.10. --Lakshmi -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Monday, May 28, 2007 7:38 AM To: Tomcat Users List Subject: RE: Tomcat Native Library Breaks SSL From: Mike Grandmaison [mailto:[EMAIL PROTECTED] Subject: Tomcat Native Library Breaks SSL Windows XP Tomcat 5.5.23 http://tomcat.heanet.ie/native/1.1.10/binaries/win32/ I followed the openssl instructions at http://www.galatea.com/flashguides/tomcat-ssl-5-unix to setup my ssl. You might try following the real documentation: http://tomcat.apache.org/tomcat-5.5-doc/apr.html#HTTPS - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Web application receives request parameters sent to another application on Tomcat 6
On 5/28/07, Dejan Krsmanovic [EMAIL PROTECTED] wrote: We have two applications running on the same Tomcat instance. These two applications are used by completely different people and one of them has much higher traffic than another one. Recently we have upgraded to Tomcat 6.10 and start experiencing strange behavior. After a lot of debugging, we have noticed that the first application sometimes receives request parameters sent to second application. Parameters are mixed-up, that is, request.getParameterMap() returns parameters from both applications. This is not happening all the time (probably because one of these applications is used rarely), but we had this situation several times a day. After some time we have decided to return back to Tomcat 5.5.x and the problems stopped. What can be reason for such problems? Is it possible that Tomcat re-uses some objects internally without clearing them up? It is hard to tell what could be the problem without knowing full details of how the 2 projects Host, Context etc are configured. Are they at the ROOT context, or other Context? Are they on a virtual host or all of them on localhost? Is crossContext set to true or false? relevant sections of server.xml , Context xml files will be useful. Regards, Dejan -Regards Rashmi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Configuring Tomcat 5.5 and IIS 6
Hi Chuck, Thanks for that. I've now downloaded and attempted to set up the jk connector - I think I've got a little further but I'm still not seeing the page that should be served up by Tomcat. I've set up a simple set of config files (essentially just grabbing them from the jakarta how-to and changing the paths), and have attempted to visit www.mydomain.com/main.jsp however I'm still getting a 404. I'm trying to map mydomain.com/ to the tomcat context 'ols-web' but this is the bit that doesn't seem to be working. The isapi_redirect.log indicates that that requests are being forwarded to tomcat, I think: = [Mon May 28 17:08:16 2007] [3972:2044] [debug] jk_uri_worker_map.c (601): Attempting to map context URI '/*=worker1' source 'uriworkermap' [Mon May 28 17:08:16 2007] [3972:2044] [debug] jk_uri_worker_map.c (616): Found a wildchar match '/*=worker1' [Mon May 28 17:08:16 2007] [3972:2044] [debug] jk_isapi_plugin.c (1270): check if [/main.jsp] is points to the web-inf directory [Mon May 28 17:08:16 2007] [3972:2044] [debug] jk_isapi_plugin.c (1287): [/main.jsp] is a servlet url - should redirect to worker1 = ...but possibly not to the right context. Any ideas? My config files are shown below... Cheers, Richard workers.properties: == # Define 1 real worker using ajp13 worker.list=worker1 # Set properties for worker1 (ajp13) worker.worker1.type=ajp13 worker.worker1.host=XXX.XXX.220.132 worker.worker1.port=8009 worker.worker1.mount=/ols-web /ols-web/* == uriworkermap.properties: == /*=worker1 == isapi_redirect.properties: == # Configuration file for the Jakarta ISAPI Redirector # The path to the ISAPI Redirector Extension, relative to the website # This must be in a virtual directory with execute privileges extension_uri=/jakarta/isapi_redirect.dll # Full path to the log file for the ISAPI Redirector log_file=d:\tomcat 5.5\logs\isapi_redirect.log # Log level (debug, info, warn, error or trace) log_level=debug # Full path to the workers.properties file worker_file=d:\tomcat 5.5\conf\workers.properties # Full path to the uriworkermap.properties file worker_mount_file=d:\tomcat 5.5\conf\uriworkermap.properties == Caldarale, Charles R wrote: From: rcgeorge23 [mailto:[EMAIL PROTECTED] Subject: Configuring Tomcat 5.5 and IIS 6 I downloaded jakarta-tomcat-connectors-jk2.0.4-win32-IIS.zip, Oops. The mod_jk2 package has been deprecated for over two years; you should be using mod_jk. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Configuring-Tomcat-5.5-and-IIS-6-tf3823529.html#a10838586 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Excluding JSP compiler from Tomcat
On 5/28/07, lightbulb432 [EMAIL PROTECTED] wrote: Thanks for your response. For the first of the two options you presented, what exactly happens during the web.xml autogeneration? Will it simply change only the servlet elements but leave everything else as is in my current web.xml, including servlet-mapping? Is there anything else it changes? It depends on how you set up your Ant build to use Jasper. In any case, the original web.xml gets modified , the original mappings etc will be retained, the new JSP class mappings will be ~appended~ , so you won't lose anything that was already there. If you don't want your original web.xml to be modified, using Ant you can make an intermediate copy of your project, and run Jasper on that intermediate copy, this way the web.xml of the source files will not change - which is ideal for development environment settings. Try it on a separate, small project to see how it works and what works for you. The less it changes, the more my development (pre-deployment) would be as close to production as possible, I'm guessing... Thanks. -Regards Rashmi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 6.0.13 issue with web.xml generated by Eclipse
I allow Eclipse to generate and update my web.xml file for me as part of a dynamic web project. When it generates the web.xml, it uses project facets to add namespaces to my web.xml file as below: web:web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns=http://java.sun.com/xml/ns/javaee; xmlns:web=http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; id=WebApp_ID version=2.5 web:servlet description/description display-nameTestServ/display-name web:servlet-nameTestServ/web:servlet-name web:servlet-classcom.llamabuy.servlet.TestServ/web:servlet-class /web:servlet I found that this causes Tomcat to be unable to load the project, returning the following exception: May 28, 2007 11:07:29 AM org.apache.catalina.core.StandardContext listenerStart SEVERE: Error configuring application listener of class |CONFIG_LISTEN_CLASS| java.lang.ClassNotFoundException: |CONFIG_LISTEN_CLASS| at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3770 It seems I would need to change something in Tomcat to allow it to handle the web.xml context above. Any help would be appreciated. Sincerely, Michael [EMAIL PROTECTED]
Re: Tomcat Native Library Breaks SSL
You might try following the real documentation: http://tomcat.apache.org/tomcat-5.5-doc/apr.html#HTTPS - Chuck Thank you, actually I found an old message from you when I searched the archive and that is how I thought to remove the native library in order to get my install to work again. I did take a look at that documentation and that is what I based my conf/server.xml file on but it comes up with the same problem where the browsers sits there until it gives up. The documentation that you point out, however, does not show how to generate all the self signed certs using openssl so that documentation on its own isn't very useful and even the piece that is supposed to work isn't working for me. It is too bad that there isn't good debugging output for ssl or a warning on the APR documentation that details this issue. Seems I'll have to dig into the source to figure out what the problem is. I think now that I know that it is an issue I'll just not bother with the native library and use tomcat without it, if my performance does become a problem then I guess I'll jump into the source at that point. MG Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Web application receives request parameters sent to another application on Tomcat 6
Rashmi Rubdi wrote: It is hard to tell what could be the problem without knowing full details of how the 2 projects Host, Context etc are configured. Are they at the ROOT context, or other Context? No, they are on different contexts (not ROOT). Are they on a virtual host or all of them on localhost? Both applications are on localhost. Virtual hosts are not used. Is crossContext set to true or false? crossContext attribute is not set, thus I assume it should be false by default. relevant sections of server.xml , Context xml files will be useful. Server.xml has default values (we didn't changed it). Both applications have their own context.xml files specified. There is nothing special in it; reloadable is set to false and both applications have data source defined as resource. Just to mention - one of these two applications is accessed by users with browsers only while second application is accessed by both browsers and hand held devices (Pocket PCs). The devices use .Net application which sends POST request with data in one large String. When servlet on the second application receives request from device, it sometimes contains additional request parameters that are not sent by device. We have discovered that these parameter names are used in the second application, that is parameters from both applications are somehow mixed-up. We suspect that problem arises when both applications are used at the same time, but we could not verify it (we have just analyzed log files). As I said, we had this problem on Tomcat 6.10 only. Tomcat 5.5.x works fine with the same context configuration. Regards, Dejan - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Excluding JSP compiler from Tomcat
Well, you didn't say what version of Tomcat you're using. Those files do indeed exist, in Tomcat 5.5. For Tomcat 6, in the lib directory you'll see 3 Jasper jars. Try removing those. I don't know if it'll cause any problems, but you'll only save a couple of MB of disk space, and no runtime memory (since you're not using those classes anyway), and you'll have to maintain your own custom Tomcat install. -- Len On 5/28/07, lightbulb432 [EMAIL PROTECTED] wrote: I can't seem to find either of those two files in the Tomcat 6 distribution...interesting. Bill Barker-2 wrote: lightbulb432 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The JSP spec says that if you precompile JSPs you can reduce the JSP container footprint by excluding the JSP compiler. How can this be done in Tomcat? You should be able to remove jasper-compiler.jar and jasper-compiler-jdt.jar from $CATALINA_HOME/common/lib (for a whopping savings of 1.5MB). I haven't tested it, so your milage may very :). Thanks. -- View this message in context: http://www.nabble.com/Excluding-JSP-compiler-from-Tomcat-tf3817429.html#a10807251 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Excluding-JSP-compiler-from-Tomcat-tf3817429.html#a10837532 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Web application receives request parameters sent to another application on Tomcat 6
It is possible that Tomcat resuses request objects. I'm not sure it does, but it might. For that reason, you're only allowed to use the request object in your servlet's doGet or doPost method, you can't stash it somewhere (e.g. in the HttpSession) and access it later. (This is mentioned in the servlet spec.) Of course I don't know if that's your problem, it's just something that came to mind. -- Len On 5/28/07, Dejan Krsmanovic [EMAIL PROTECTED] wrote: We have two applications running on the same Tomcat instance. These two applications are used by completely different people and one of them has much higher traffic than another one. Recently we have upgraded to Tomcat 6.10 and start experiencing strange behavior. After a lot of debugging, we have noticed that the first application sometimes receives request parameters sent to second application. Parameters are mixed-up, that is, request.getParameterMap() returns parameters from both applications. This is not happening all the time (probably because one of these applications is used rarely), but we had this situation several times a day. After some time we have decided to return back to Tomcat 5.5.x and the problems stopped. What can be reason for such problems? Is it possible that Tomcat re-uses some objects internally without clearing them up? Regards, Dejan - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Installing ISAPI redirect for IIS
I've got a Windows 2000 server running IIS (IIS 5.x) and I've installed Apache Tomcat 6.0. I want to install the ISAPI redirector. I've accessed the following instructions: http://tomcat.apache.org/connectors-doc-archive/jk2/jk2/installhowto.html but according to one post I've read on this forum, redirector2.dll is no longer actively supported. There is a download at: http://tomcat.apache.org/download-connectors.cgi for a redirect.dll, but I haven't seen any instructions for implementing it. Can I simply follow the instructions at the above installhowto.html site for redirect.dll? Is there an even better way of doing this? === Al - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using servlet and mysql
Hi, I would like to access mysql database from a servlet but I'm not sure what to initialize for the String connectionURL marked as jdbc:mysql://localhost:/xxx in the program below. I got this program from the internet which I would like to run in my computer. Can anyone please explain to me what the parameters and xxx should be? Yours Sincerely, TEH Following is part of the program: ... public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ response.setContentType(text/html); PrintWriter pw = response.getWriter(); String connectionURL = jdbc:mysql://localhost:/xxx; Connection connection=null; try{ String username = request.getParameter(username); String password = request.getParameter(password); pw.println(username); pw.println(password); Class.forName(com.mysql.jdbc.Driver).newInstance(); connection = DriverManager.getConnection(connectionURL, root, root); PreparedStatement pst = connection.prepareStatement (insert into login_table values(?,?)); ... - Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when.
Re: Using servlet and mysql
Hi, would be ur database port, xxx will be ur database name HTH FooShyn Teh Noranis Mohd Aris wrote: Hi, I would like to access mysql database from a servlet but I'm not sure what to initialize for the String connectionURL marked as jdbc:mysql://localhost:/xxx in the program below. I got this program from the internet which I would like to run in my computer. Can anyone please explain to me what the parameters and xxx should be? Yours Sincerely, TEH Following is part of the program: ... public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ response.setContentType(text/html); PrintWriter pw = response.getWriter(); String connectionURL = jdbc:mysql://localhost:/xxx; Connection connection=null; try{ String username = request.getParameter(username); String password = request.getParameter(password); pw.println(username); pw.println(password); Class.forName(com.mysql.jdbc.Driver).newInstance(); connection = DriverManager.getConnection(connectionURL, root, root); PreparedStatement pst = connection.prepareStatement (insert into login_table values(?,?)); ... - Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.8.0/821 - Release Date: 5/27/2007 3:05 PM - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using servlet and mysql
Thank you so much for the reply. I've put jdbc:mysql://localhost:8080/teh but I got the error java.lang.ClassNotFoundException: com.mysql.jdbc.Driver. I'm very new to using mysql database and servlet. Can you please explain to me how to create the database name and its fields? Should I install any driver? How can it be done? Please help. Thank you. Yours Sincerely, TEH Foo Shyn [EMAIL PROTECTED] wrote: Hi, would be ur database port, xxx will be ur database name HTH FooShyn Teh Noranis Mohd Aris wrote: Hi, I would like to access mysql database from a servlet but I'm not sure what to initialize for the String connectionURL marked as jdbc:mysql://localhost:/xxx in the program below. I got this program from the internet which I would like to run in my computer. Can anyone please explain to me what the parameters and xxx should be? Yours Sincerely, TEH Following is part of the program: ... public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ response.setContentType(text/html); PrintWriter pw = response.getWriter(); String connectionURL = jdbc:mysql://localhost:/xxx; Connection connection=null; try{ String username = request.getParameter(username); String password = request.getParameter(password); pw.println(username); pw.println(password); Class.forName(com.mysql.jdbc.Driver).newInstance(); connection = DriverManager.getConnection(connectionURL, root, root); PreparedStatement pst = connection.prepareStatement (insert into login_table values(?,?)); ... - Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.8.0/821 - Release Date: 5/27/2007 3:05 PM - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Shape Yahoo! in your own image. Join our Network Research Panel today!