Java语言如何访问不同字符集的Oracle数据
一、java访问中文Oracle数据库上连接的US7ASCII数据库
1、读方法
public String convertLink_DB(String s) {
if(s != null){
try{
byte[] b = s.getBytes();
for(int i=0; i<b.length; i++){
b[i] = (byte)(b[i]-128);
}
return new String(b, "gb2312");
}catch(Exception e){
e.printStackTrace();
return "";
}
}
return "";
}
2、写方法
public String convertLink_DB(String s) {
if(s != null){
try{
byte[] b = s.getBytes();
for(int i=0; i<b.length; i++){
b[i] = (byte)(b[i]+128);
}
return new String(b, "gb2312");
}catch(Exception e){
e.printStackTrace();
return "";
}
}
return "";
}
一、java访问英文Oracle数据库
1、读
new String(s, "gb2312");
2、写
new String(s, "8859-1");
相关文档:
Java串口通讯
串行通讯协议有很多种,像RS232,RS485,RS422,甚至现今流行的USB等都是串行通讯协议。而串行通讯技术的应用无处不在。可能大家见的最多就是电脑的串口与Modem的通讯。记得在PC机刚开始在中国流行起来时(大约是在90年代前五年),那时甚至有人用一条串行线进行两台电脑之间的 ......
public class Migong {
private int gard[][]={ {1,1,1,1,0,1,1,1},
{0,0,0,1,1,1,1,1},
......
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体" ......
最近研究了下分页,做个总结。
1)数据库操作类,做简单封装 DB.java
package Test;
import java.sql.*;
public class DB {
// 加载驱动
static {
try {
Class.f ......
package fileTest;
import java.io.*;
public class FileOperate {
public FileOperate() {
}
public static void main(String args[]){
// newFolder("D:/100");
moveFile("e:/978 ......