启动mysql服务器C:/mysql51>cd binC:/mysql51/bin>mysqld --console并建立数据库C:/mysql51/bin>mysql -u rootWelcome to the MySQL monitor. Commands end with ; or /g.Your MySQL connection id is 1Server version: 5.1.14-beta-community MySQL Community Server (GPL)Type 'help;' or '/h' for help. Type '/c' to clear the buffer.mysql> show databases-> ;+--------------------+| Database |+--------------------+| information_schema || mysql |+--------------------+2 rows in set (0.00 sec)mysql> create database test;Query OK, 1 row affected (0.01 sec)mysql> use testDatabase changedmysql> create table a1(c1 varchar(30));Query OK, 0 rows affected (0.02 sec)mysql> insert into a1 values ('Hello World');Query OK, 1 row affected (0.00 sec)进入jython环境访问mysqlC:/jython2.2.1>jythonJython 2.2.1 on java1.6.0Type "copyright", "credits" or "license" for more information.>>> from com.ziclix.python.sql import zxJDBC>>> mysqlConn = zxJDBC.connect("jdbc:mysql://localhost/test",... "root", "",... "org.gjt.mm.mysql.Driver")>>> cursor = mysqlConn.cursor()>>> cursor.execute("SELECT * FROM a1");>>> cursor.fetchone()('Hello World',)>>> cursor.fetchall()[]>>> cursor.description[('c1', 12, 30, None, None, None, 1)]>>> |