Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

tomcat6+mysqlÁ¬½Ó³ØµÄ¼òµ¥ÊµÏÖ(Ç××ÔÊÔÑéͨ¹ý)

ÔÚÍøÉÏÕÒÁ˺ܾã¬ÎÄÕ¶¼ÊÇÄã³­¡¢ÎÒ³­Äã¡£¿´À´¿´È¥¶¼Ò»ÑùµÄ£¬googleÍùºó·­NÒ³  ½øÈ¥Ò»¿´¶¼ÊÇÒ»ÑùµÄ¡£ÓôÃÆÖÁ¼«¡£ ÓÚÉÏÊÇCSDNÂÛ̳ÇóÖú£¬»¹ÊÇjava\web̳×ÓÀïµÄÅóÓÑÈÈÇéЩ£¬ÖÕÓÚËãÊǸãºÃÁË£¬×Ô¼ºÔÙÊÔÁËÏ£¬°ÑÐĵ÷¢³öÀ´´ó¼ÒÖ¸µãÖ¸µã¡£ 1¡¢mysql-connector-java-5.0.8-bin.jarÎļþ£¬Ò²¾ÍÊÇmysqlÇý¶¯°ü¡£×¢Ò⣺Ҫ·Åµ½tomcat6/libĿ¼Ï¡£·Åµ½web-inf/libϲ»ÐУ¬²»ÖªµÀΪʲô£¬ÎÒ»áÔÙÊÔÊÔ¡£ 2¡¢ÐÞ¸Ätomcat6/conf/context.xmlÎļþ£¬ÒÔ<context>±êǩ֮¼ä¼ÓÉÏ 1: <Resource name="jdbc/mysql"
2: auth="Container"
3: type="javax.sql.DataSource"
4: driverClassName="com.mysql.jdbc.Driver"
5: url="jdbc:mysql://localhost:3306/test"
6: username="root"
7: password="root"
8: maxActive="100"
9: maxIdle="30"
10: maxWait="5000" />
 
Òâ˼Ӧ¸ÃÒ»¿´¾ÍÄÜÃ÷°×£¬¾Í²»½âÊÍÁË¡£
3¡¢²âÊÔÒ³Ãæ
1: <!doctype html public "-//w3c//dtd html 4.0 transtional//en"
2: "help://www.w3.org/TR/REC-html40/strict.dtd">
3: <%@ page import="java.sql.*,javax.sql.*,javax.naming.*" session="false" %>
4: <html>
5: <head>
6: <meta http-equive="Content-Type" content="text/html"; charset="gbk">
7: <title></title>
8: <body>
9:
10: <%
11: out.println("¿ªÊ¼²âÊÔ!");
12: DataSource ds;
13: InitialContext ctx;
14: try{
15: ctx=new InitialContext();
16: ds=(DataSource)ctx.lookup("java:comp/env/jdbc/mysql");
17: Connection con=ds.getConnection();
18: Statement stmt=con.createStatement();
19: String sql="select * from person";
20: ResultSet rs=stmt.executeQuery(sql);
21: while(rs.next()){
22: out.println(rs.getString(2));
23: }
24: out.println("²âÊԳɹ¦£¡");
25: }
26: catch(Exception e){
27: out.println(e.toString());
28: }
29:
30: %>
31: </body>
32:


Ïà¹ØÎĵµ£º

MYSQL ±¸Íü¼

MySQL client programs:
mysql
The command-line tool for interactively entering SQL statements or executing them from a file in batch mode. See Section 4.5.1, “mysql — The MySQL Command-Line Tool”.
mysqladmin
A client that performs administrative operations, such as crea ......

MySql´´½¨º¯Êý

Ê×ÏÈÐèÒª²é¿´Ò»Ï´´½¨º¯ÊýµÄ¹¦ÄÜÊÇ·ñ¿ªÆô£º
X:\proper\mysql\bin>mysql -h localhost -u root -p
Enter password: **********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 5.0.22-community-nt-log
Type 'help;' or '\h' for help. Type ' ......

ÓÃmysql×÷openldapµÄºǫ́Êý¾Ý¿â

etting up OpenLDAP with MySQL backend
ÓÃmysql×÷ºǫ́Êý¾Ý¿â°²×°openldap
author: TBONIUS
OpenLDAP is an X.500 Lightweight Directory Access Server used for
centralized authentication and directory lookups. ......

MySQLµÄ¼¸¸öÖØÒªÄ¿Â¼½éÉÜ

     MySQL°²×°Íê³Éºó²»ÏóSQL ServerĬÈϰ²×°ÔÚÒ»¸öĿ¼£¬ËüµÄÊý¾Ý¿âÎļþ¡¢ÅäÖÃÎļþºÍÃüÁîÎļþ·Ö±ðÔÚ²»Í¬µÄĿ¼£¬Á˽âÕâЩĿ¼·Ç³£ÖØÒª£¬ÓÈÆä¶ÔÓÚLinuxµÄ³õѧÕߣ¬ÒòΪ Linux±¾ÉíµÄĿ¼½á¹¹¾Í±È½Ï¸´ÔÓ£¬Èç¹û¸ã²»Çå³þMySQLµÄ°²×°Ä¿Â¼ÄǾÍÎÞ´Ó̸ÆðÉîÈëѧϰ¡£ÏÂÃæ¾Í½éÉÜÒ»ÏÂÕ⼸¸öĿ¼¡£
£¨1£©Êý¾Ý¿âĿ¼ ......

»ùÓÚmysqlµÄweb³ÌÐòµÄÒ»¸öÐÔÄÜÌáÉýµÄ·½°¸

½ñÌìºÍһλ¼Ü¹¹Ê¦ÁÄÁËһЩÎÊÌ⣬ºÜżȻµÄ˵³öÁËÒ»¸öÊÂÇ飬ÎұȽϸÐÐËȤÓÚÊǼǼһÏ£º
1£ºÎÒÃǶ¼ÖªµÀmysqlÏ µÄINNODBºÍMYISAMÁ½ÖÖÒýÇæ£¬ÆäÖÐINNODB¾ßÓÐÊÂÎï¹ÜÀí¡£ËùÒÔINNODBϲÙ×÷ºÍMYISAMϲÙ×÷£¬µ¥´¿µÄ´Ó²åÈëÊý¾Ý¿âÉÏ˵£¬INNDODBµÄ¿É¿¿£¬²éѯÉÏ˵MYISAMµÄÒª¿ì¡£
2£º»ùÓÚÉÏÃæµÄÌØÐÔ£¬ÒÔ¼°MYSQLjuyouµÄÖ÷´Ó»úÖÆ£¬ÎÒÃÇ¿ÉÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ