1、Oracle8/8i/9i数据库(thin模式)
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:orcl"; //orcl为数据库的SID
String user="test";
String password="test";
Connection conn= DriverManager.getConnection(url,user,password);
2、DB2数据库
Class.forName("com.ibm.db2.jdbc.app.DB2Driver ").newInstance();
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:orcl"; //orcl为数据库的SID
String user="test";
String password="test";
Connection conn= DriverManager.getConnection(url,user,password);
2、DB2数据库
Class.forName("com.ibm.db2.jdbc.app.DB2Driver ").newInstance();
Tags: JDBC
1.在建数据库时要用如下语句:
Create DATABASE JForum DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
For detailed error information, please see the HTML source code, and contact the forum Administrator.
java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (utf8_general_ci,IMPLICIT) for operation 'UNION'
Query being executed when exception was thrown:
Create DATABASE JForum DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
For detailed error information, please see the HTML source code, and contact the forum Administrator.
java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (utf8_general_ci,IMPLICIT) for operation 'UNION'
Query being executed when exception was thrown:
Tags: jforum
使用html:radio做选中常用两种方法,一种是order中属性给其默认值,二种在js页面使用js赋值
还有一种更加简单的,使用传统html表单的type=radio,修改name成相应属性,一样可以在action中拿到值,如下:
姓名:<html:text property="order.uname"></html:text>
性别:男<input type="radio" name="order.sex" value="男" checked="checked"></input>
女<input type="radio" name="order.sex" value="女"></input>
还有一种更加简单的,使用传统html表单的type=radio,修改name成相应属性,一样可以在action中拿到值,如下:
姓名:<html:text property="order.uname"></html:text>
性别:男<input type="radio" name="order.sex" value="男" checked="checked"></input>
女<input type="radio" name="order.sex" value="女"></input>
Tags: radio