/** * Probably same thing as Bug#27867 */ package testsuite.simple; import java.sql.CallableStatement; import java.sql.Connection; import java.util.Properties; import testsuite.BaseTestCase; public class TestBug28567 extends BaseTestCase { public TestBug28567(String name) { super(name); // TODO Auto-generated constructor stub } public void testBug28567() throws Exception { try { System.out.println("java.vm.version : " + System.getProperty("java.vm.version")); System.out.println("java.vm.vendor : " + System.getProperty("java.vm.vendor")); System.out.println("java.runtime.version : " + System.getProperty("java.runtime.version")); System.out.println("os.name : " + System.getProperty("os.name")); System.out.println("os.version : " + System.getProperty("os.version ")); System.out.println("sun.management.compiler : " + System.getProperty("sun.management.compiler")); createTable("`bug28567`", "(`ID` int(11) NOT NULL,`NAME` varchar(80) NOT NULL,PRIMARY KEY (`ID`),UNIQUE KEY `UQ_TYPES_NAME` (`NAME`)) ENGINE=InnoDB DEFAULT CHARSET=gb2312"); this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS SP_BUG28567"); this.stmt.executeUpdate("create procedure SP_BUG28567(IN P_ID INT, IN P_NAME VARCHAR(80))\n" + "begin\n" + "INSERT INTO bug28567 (`ID`, NAME) VALUES (P_ID, P_NAME);\n" + "end\n"); Properties props = new Properties(); //props.put("useInformationSchema", "true"); props.put("useUnicode", "true"); props.put("characterEncoding", "GB2312"); //props.put("zeroDateTimeBehavior","convertToNull"); Connection conn1 = null; conn1 = getConnectionWithProps(props); CallableStatement cmd=conn1.prepareCall("CALL SP_BUG28567(?,?)"); cmd.setInt(1, 1); cmd.setString(2, "中文"); cmd.execute(); cmd.close(); conn1.close(); this.rs = this.stmt.executeQuery("SELECT * FROM bug28567"); this.rs.first(); System.out.println(2 + " .fld: " + this.rs.getString(2)); } finally { closeMemberJDBCResources(); } } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub junit.textui.TestRunner.run(TestBug28567.class); } }