Java and MySQLMySQL is the world fastest SQL database, which is available for most platform. Through JDBC driver, our Java programs can insert and query the data on MySQL. MM Mysql Driver is the complete JDBC2.0 implementation, by which we can use PreparedStatement. Once the instance of PreparedStatement is retrieved, we can execute it again and again along with the different parameters. For example: The 2 arrays of Strings are inserted into "my_tbl" by this simple code.Java is Internationalization readyWithin our Java code, once the instance of String is created, we need not pay any attention whether it consists of all the ASCII characters or not. For example: In the Japanese language environment, JVM tries to find "MyResource_ja.properties" in its CLASSPATH and parse its contents if found. In case that "MyResource_ja.properties" does not exist in the CLASSPATH, "MyResource.properties" will be parsed as the default property file instead. Anyway, the instance of ResourceBundle is created based on the property file, and it provides us with the instance of String appropriate for the runtime environment.Thus, the instance of String with NON-ASCII characters can easily be created. And such an instance of String can be treated as if it is all the ASCII String. To create the property file for NON-ASCII characters, we should use "native2ascii" tool which is supplied with JDK. For details about these features, please read the JDK documentation or Java Tutorial. As for the Strings on Swing GUI, you can write them in the XML file. This can easily be done by OOP XMLPanelEdit. It's FREE for non-commercial use. And MySQL can be!
But what happens to store the NON-ASCII Strings into SQL database? When MySQL is compiled for ASCII charset, all the NON-ASCII Strings inserted into table was corruped. Query on such a culumn fails. Although MySQL can be compiled for the specific charset, it cannot be capable for the Strings other than that charset. How happy we are if MySQL can be Internationalization ready as Java. If it is, we can take the full advantage of Java and MySQL can serve as SQL database behind the web application for almost all the language in the world!
Query on this kind of column can be done by the same way: Note that resulting String must be reverted through the procedure in reverse order. |