Label:The first two articles describe how to configure MyEclipse and Tomcat to develop JSP Web sites, how to configure the servlet simple implementation form submission, this article mainly describes the configuration of MySQL implementation database connection MyEclipse, and finally the query table data displayed in the JSP Web page. The main picture is mainly described in the article, please Haihan ~Java+
First, import the MySQL jar package into the Tomcat/lib folderAnd then configure the following in the Tomcat/conf/context.xml fileResourcename= "Jdbc/mysql"Auth= "Container"type= "Javax.sql.DataSource"maxactive= "+"Maxidle= "+"maxwait= "10000"Driverclassname= "Com.mysql.jdbc.Driver"URL= "jdbc:mysql://server address: Po
In fact, the two Database Connection Methods of MySQL and SQL Server are very similar.
The encoding format uses uriencoding = "UTF-8" you can set as GBK or gb2312 as needed, but I personally strongly recommend that allUTF-8
For example, Mysql Data Connection Pool settings:
1. Copy the MySQL driver file mysql. jar to
"java_home" Variable Value "C:\JAVA" is the address of the JAVA file found Path variable edit at the end of the variable value added ";%java_home%\bin"New system variable variable name "CLASSPATH" Variable Value ".; Java_home%\lib\dt.jar;%java_home%\lib\tools.jar; " Click OK to configure the successOpen command Enter JAVAC validation after completion. TOMCAT InstallationDownload installation package Double-click InstallAfter the installation is compl
Click the Ubuntu system gt; System Management gt; the new software package manager searches for the jdkmysql keyword, and select the software source to be installed from the search list: configuration ~. Bashrc
Click Ubuntu system = gt; System Management = gt; New Software Package Manager to search for the jdk mysql keyword. In the search list, select software source 1: configuration ~ /. Bashrc
Click Ubuntu system => System Management => New Sof
Click Ubuntu system = gt; System Management = gt; New Software Package Manager to search for the jdkmysql keyword. In the search list, select the software source to be installed. 1: Configure ~ /. The default installation path of the bashrc file JDK/usr/lib/jvm/In ~ /. Add JAVA_HOME =/usr/lib/jvm/java-1.5.0-sunJAVA_BIN =/usr/lib/jvm/java-1.5.0-
Click Ubuntu system => System Management => New Software Package Manager
Search for the jdk mysql keyword
="Jdbc:mysql://13.51.23.24:3010/zplatdb"
username="Zplat_cen1"
Password="12345"
maxactive=" the"
Maxidle="a"
maxwait="10000"
removeabandoned="true"
Removeabandonedtimeout=" the"
logabandoned="true"
Defaultautocommit="false"/>3, IsValid (I) Zcaused By:java.lang.AbstractMethodError:com.mysql.jdbc.Connection.isValid (I) ZFIX: MySQL jar version number is too low, instead of
Tags: blog http os ar using SP file Data artOne, no longer for the Apache process siltation, depletion of memory and troubled0./etc/my.cnf, add the following line to the mysqld paragraph:Log-slow-queries=queries-slow.log
Restart MySQL
As appropriate, for a period of time, execute the mysqldumpslow command, or view Datadir/queries-slow.log directly, to find out the SQL statement that executes the timeout. Where DataDir is the storage path
" Password="12345" maxactive=" the" Maxidle="a" maxwait="10000" removeabandoned="true" Removeabandonedtimeout=" the" logabandoned="true" Defaultautocommit="false"/>3, IsValid (I) Zcaused By:java.lang.AbstractMethodError:com.mysql.jdbc.Connection.isValid (I) ZFIX: MySQL jar version is too low, instead of Mysql-connector-java-5.1.34.jar (note the latest is 5.1.35, lazy
The configuration in Tomcat, which was previously used, can be found:
The autoreconnect = true argument to the URL makes sure that
Mm. MySQL JDBC driver will automatically reconnect if mysqld closed
The connection. mysqld by default closes idle connections after 8 hours. -->
Configure your mysqld max_connections large enough to handle
All of yo
Environment:
Jdk1.4 + Tomcat 5
I. environment variables:
Path: C:/j2sdk1.4.2/bin;
Java_home: C:/j2sdk1.4.2/
Note: Only the two.
II. JDBC driver
Copy the corresponding JDBC driver to tomcat5/common/libThree. Jar files in the SQL Server 2000 (or MySQL) for JDBC/lib/directory:Msbase. JarMSSQLServer. JarMsutil. Jar
Iii. virtual directory and Connection Pool
Suppose you want to create your own virtual directory
Label:Need to add the following in the configuration file okhttp://blog.csdn.net/zhq426/article/details/9787071/Tomcat links MySQL When the error Java.io.EOFException:Can not read response from server. Expected to read 4 bytes,
1. Environment initialization1) Install GCC software suite:: Yum install gcc otherwise error configure:error:no acceptable C compiler found in $PATH2) Install Unzip: Yum install-y unzip zip otherwise will error Unzip:command not found3) Install the C + + compilation environment: Yum Groupinstall "Development Tools" because later pcre need to be compiled in C + +. Note (Debian system uses command apt-get, corresponding toolkit for build-essential, command usage: Apt-get install build-essential)4)
. xml configuration filter method (Web. xmd)
/*********************** With the above basic solution for the interview ***** ************************************/1. Solutions Using GBK EncodingThe simplest way to set the encoding is to use the GBK database GBK and then use a filter to filter and encode it into GBK.Effect: add data without garbled characters read data without garbled characters database management tool without garbled code everywhere SQL structure and data without garbled characte
Configure the MySQL database connection pool in Tomcat [Author: alias post: It lab hits: 11149 updated:]
1. Add the configuration information in $ catalina_home/CONF/server. XML to declare the specific information of the connection pool. Add the following content:
2. Add the following information before $ catalina_home/CONF/Web. xml
The parameter names in
3. Find the c
Tags: des style class blog C codeGet the DataSource resource from the server container through Jndi (managed by the container, do not close it, the container will handle it itself) the previous article we used is DBCP, which uses Jndi:To connect data using Jndi:In Spring commentUse:One, add database driver fileAccess to the database through the data source, since the data source is created and maintained by Tomcat, it is necessary to copy the
" directory=prefix= "Localhost_access_ Log "suffix=". txt "pattern=host> ENGINE>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Please take care to add a piece of code between host"blog" path="" debug="0" reloadable="true"/>
1
This blog is placed in the WebApps Project War package name, through the IP or domain name directly into the blog, will not appear
, you need to execute the following command:Systemctl status Firewalld #used The following command to enable the firewall Systemctl unmask firewalld systemctl Enable Firewalld systemctl start firewalld systemctl status Firewalld #下面操作与上面使用firewalld开启防火墙一样MySQL creates a user and opens the appropriate permissionsGrant all privileges on * * to [e-mail protected] identified by ' 123456 ';Grant all privileges on * * to [email protected] '% ' identified by
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.