Posted by chenyue on 7月 30th, 2009
To setup an Oracle Datasource in Glassfish, follow these steps:
1. Copy the Oracle JDBC drivers to /glassfish/domains/domain1/lib/ext directory. You may need to change the directory /glassfish/domains/domain1 to match your installation of Glassfish and the domain name.
2. Start Glassfish.
3. Login to the admin interface and create a JDBC Connection Pool.
Delete all properties, and add following properties:
user - set this to Oracle userid
password - set this to Oracle password
URL - set this to the URL, example jdbc:oracle:thin:@localhost:1521:xe.
xa-driver-does-not-support-non-tx-operations - set this to true.
Test the connection pool using ping.
4. Create a JDBC DataSource using the Connection Pool.
Posted by chenyue on 7月 24th, 2009
// SET ENV - Umgebungsvariablen fuer Sprache setzen
putenv(’LC_ALL=de_DE.UTF-8′);
putenv(’LANGUAGE=de_DE.UTF-8′);
putenv(’NLS_LANG=GERMAN_GERMANY.UTF8′);
或者在
说明
设置环境变量
语法
SetEnv env-variable value
作用域
server config, virtual host, directory, .htaccess
覆盖项
FileInfo
状态
基本(B)
模块
mod_env
设置一个环境变量,该变量将会传送到CGI脚本和SSI页面。例如:
示例
SetEnv SPECIAL_PATH /foo/bin
这样在 $APACHE_HOME/conf/httpd.conf 中加入
PassEnv ORACLE_HOME
PassEnv LD_LIBRARY_PATH
PassEnv LANG
PassEnv NLS_LANG
或
SetEnv LANG zh_CN.UTF-8
SetEnv NLS_LANG American_America.zhs16cgb231280
SetEnv ORACLE_HOME /home/oracle/oracle/product/10.2.0/client_1
SetEnv LD_LIBRARY_PATH /home/oracle/oracle/product/10.2.0/client_1/lib:$LD_LIBRARY_PATH
Posted by chenyue on 7月 23rd, 2009
Here are instructions for setting the default character set in Netbeans to UTF-8 (in Windows):
- Go to C:\Program Files\netbeans-x.x\etc
- Open netbeans.conf in Notepad.
- On the netbeans_default_options add: -J-Dfile.encoding=UTF-8. (make sure to put it within the quotation marks)
- Project properties -> Build -> Compiling ->
- Additional compiler options) text box.- add: -encoding UTF-8
- You can also check to make sure that you have increased the memory allocation for Netbeans by looking at the netbeans_default_options line. The default max is 128MB. We have increased this to 256MB.
References:
http://wp.uberdose.com/2007/05/07/netbeans-and-utf-8/
http://www.techienuggets.com/Comments?tx=619
Posted by chenyue on 7月 15th, 2009
下面是一些特殊的标记或字符,你可以利用它们插入注释或可能被视为具有特殊含义的字符。 语法 用途
<%– comment –%> JSP注释,也称为“隐藏注释”。JSP引擎将忽略它。标记内的所有JSP脚本元素、指令和动作都将不起作用。
<!– comment –> HTML注释,也称为“输出的注释”,直接出现在结果HTML文档中。标记内的所有JSP脚本元素、指令和动作正常执行。
<\% 在模板文本(静态HTML)中实际上希望出现“<%”的地方使用。
%\> 在脚本元素内实际上希望出现“%>”的地方使用。
\’ 使用单引号的属性内的单引号。不过,你既可以使用单引号也可以使用双引号,而另外一种引号将具有普通含义。
\” 使用双引号的属性内的双引号。参见“\’”的说明。
Recent Comments