Wednesday, 17 February 2016

[JDBC] Microsoft SQL Server JDBC Driver Properties

Microsoft SQL Server JDBC Driver

Property NameDescriptionReqiredChoicesSample Value
applicationNameSQL Server 프로파일링 및 로깅 도구에 대한 응용 프로그램 이름입니다.falseMicrosoft SQL Server JDBC Driver
databaseName연결되는 데이터베이스의 이름입니다.falsemaster
disableStatementPooling문 풀링 기능을 해제합니다.false
true
true
encryptSSL(Secure Sockets Layer) 암호화를 클라이언트와 서버 사이에서 사용해야 할지 여부를 결정합니다.false
true
false
false
failoverPartner데이터베이스 미러링 구성에 사용되는 장애 조치 서버의 이름입니다.false
hostNameInCertificateSQL Server SSL(Secure Sockets Layer) 인증서 유효성을 검사하는 데 사용될 호스트 이름입니다.false
instanceNameSQL Server가 연결되는 인스턴스의 이름입니다.false
integratedSecuritySQL Server 연결에 Windows 인증을 사용할지 여부를 나타냅니다.false
true
false
false
lastUpdateCount서버에 전달되는 SQL 문에서 마지막 업데이트 횟수만 반환되도록 합니다.false
true
false
true
lockTimeout데이터베이스에서 잠김 제한 시간을 보고하기 전에 대기해야 하는 시간(밀리초)입니다.false-1
loginTimeout실패한 연결 제한 시간이 초과되기 전에 드라이버에서 대기해야 하는 시간(초)입니다.false15
packetSizeSQL Server와 통신하는 데 사용되는 네트워크 패킷 크기입니다.false8000
password데이터베이스 암호입니다.true
portNumberSQL Server의 인스턴스가 수신되고 있는 TCP 포트입니다.false1433
responseBuffering적응 버퍼링 동작을 제어하여 응용 프로그램에서 서버 커서를 요구하지 않고 대형 결과 집합을 처리할 수 있도록 합니다.false
adaptive
full
adaptive
selectMethod서버 커서를 사용하도록 응용 프로그램을 설정하여 정방향 전용, 읽기 전용 결과 집합을 처리합니다.false
direct
cursor
direct
sendStringParametersAsUnicode문자열 매개 변수를 유니코드로 서버에 보낼지 또는 데이터베이스의 문자 집합에 보낼지 여부를 결정합니다.false
true
false
true
serverNameSQL Server를 실행하는 컴퓨터입니다.false192.168.0.88
trustServerCertificate드라이버에서 SQL Server SSL(Secure Sockets Layer) 인증서의 유효성을 확인해야 할지 여부를 결정합니다.false
true
false
false
trustStore인증서 신뢰 저장 파일에 대한 경로입니다.false
trustStorePassword신뢰 저장 데이터의 무결성을 확인하는 데 사용되는 암호입니다.false
sendTimeAsDatetimeSQL Server datetime 데이터 형식을 사용하여 java.sql.Time 값을 데이터베이스로 보낼지 여부를 결정합니다.false
true
false
true
user데이터베이스 사용자입니다.truesa
workstationID워크스테이션의 호스트 이름입니다.false
xopenStates드라이버가 예외에서 XOPEN 규격 SQL 상태 코드를 반환할지 여부를 결정합니다.false
true
false
false

[JDBC] Oracle JDBC Driver Properties

Oracle JDBC Driver

Property NameDescriptionReqiredChoicesSample Value
oracle.jdbc.RetainV9LongBindBehaviornullfalsefalse
usernullfalsenull
databasenullfalsenull
autoCommitnullfalsetrue
protocolnullfalsenull
oracle.jdbc.StreamChunkSizenullfalse16384
SetFloatAndDoubleUseBinarynullfalsefalse
oracle.jdbc.ocinativelibrarynullfalsenull
v$session.terminalnullfalseunknown
v$session.machinenullfalsenull
v$session.osusernullfalsenull
v$session.programnullfalseJDBC Thin Client
v$session.processnullfalse1234
v$session.inamenullfalsejdbc_ttc_impl
v$session.enamenullfalsenull
oracle.net.profilenullfalsenull
oracle.net.authentication_servicesnullfalsenull
oracle.net.kerberos5_mutual_authenticationnullfalsenull
oracle.net.kerberos5_cc_namenullfalsenull
oracle.net.encryption_clientnullfalsenull
oracle.net.encryption_types_clientnullfalsenull
oracle.net.crypto_checksum_clientnullfalsenull
oracle.net.crypto_checksum_types_clientnullfalsenull
oracle.net.crypto_seednullfalsenull
oracle.jdbc.TcpNoDelaynullfalsefalse
oracle.jdbc.ReadTimeoutnullfalsenull
oracle.net.CONNECT_TIMEOUTnullfalsenull
oracle.net.disableOobnullfalsefalse
oracle.net.useZeroCopyIOnullfalsetrue
oracle.jdbc.use1900AsYearForTimenullfalsefalse
oracle.jdbc.timestampTzInGmtnullfalsetrue
oracle.jdbc.timezoneAsRegionnullfalsetrue
oracle.net.ssl_server_dn_matchnullfalsenull
oracle.net.ssl_versionnullfalsenull
oracle.net.ssl_cipher_suitesnullfalsenull
javax.net.ssl.keyStorenullfalsenull
javax.net.ssl.keyStoreTypenullfalsenull
javax.net.ssl.keyStorePasswordnullfalsenull
javax.net.ssl.trustStorenullfalsenull
javax.net.ssl.trustStoreTypenullfalsenull
javax.net.ssl.trustStorePasswordnullfalsenull
ssl.keyManagerFactory.algorithmnullfalsenull
ssl.trustManagerFactory.algorithmnullfalsenull
oracle.net.oldSyntaxnullfalsenull
java.naming.factory.initialnullfalsenull
java.naming.provider.urlnullfalsenull
java.naming.security.authenticationnullfalsenull
java.naming.security.principalnullfalsenull
java.naming.security.credentialsnullfalsenull
oracle.net.wallet_locationnullfalsenull
oracle.net.wallet_passwordnullfalsenull
oracle.jdbc.proxyClientNamenullfalsenull
oracle.jdbc.useNionullfalsefalse
JDBCDriverCharSetIdnullfalsenull
oracle.jdbc.editionNamenullfalsenull
internal_logonnullfalsenull
oracle.jdbc.createDescriptorUseCurrentSchemaForSchemaNamenullfalsefalse
OCISvcCtxHandlenullfalse0
OCIEnvHandlenullfalse0
OCIErrHandlenullfalse0
prelim_authnullfalsefalse
OCINewPasswordnullfalsenull
defaultExecuteBatchnullfalse1
defaultRowPrefetchnullfalse10
oracle.jdbc.defaultLobPrefetchSizenullfalse4000
remarksReportingnullfalsefalse
includeSynonymsnullfalsefalse
restrictGetTablesnullfalsefalse
AccumulateBatchResultnullfalsetrue
useFetchSizeWithLongColumnnullfalsefalse
processEscapesnullfalsetrue
fixedStringnullfalsefalse
defaultNCharnullfalsefalse
RessourceManagerIdnullfalse0000
disableDefineColumnTypenullfalsefalse
oracle.jdbc.convertNcharLiteralsnullfalsefalse
oracle.jdbc.J2EE13Compliantnullfalsefalse
oracle.jdbc.mapDateToTimestampnullfalsetrue
oracle.jdbc.useThreadLocalBufferCachenullfalsefalse
oracle.jdbc.driverNameAttributenullfalsenull
oracle.jdbc.maxCachedBufferSizenullfalse30
oracle.jdbc.implicitStatementCacheSizenullfalse0
oracle.jdbc.LobStreamPosStandardCompliantnullfalsetrue
passwordnullfalsenull
servernullfalsenull
oracle.jdbc.commitOptionnullfalsenull

Sunday, 7 February 2016

[CentOS] How to set VNC-Server up

1. Installing the required packages

1.1. Check whether vnc-server package is installed.
rpm -q vnc-server

1.2. Install vnc-server using yum
#> yum -y install vnc-server

1.3. Install Window Manager
Install the "Gnome Desktop Environment" to get a full-featured GUI desktop. Other popular desktop environments are "KDE" and "XFCE-4.4".

- in CentOS 6
#> yum -y groupinstall Desktop

- in CentOS 5
#> yum -y groupinstall "GNOME Desktop Environment"

1.4. Install VNC Server
- in CentOS 6
#> yum -y install tigervnc-server

- in CentOS 5
#> yum -y install vnc-server


<!> If you are running CentOS 6, the server is: v not: vnc-server

2. Configuring VNC-Server

2.1. Configure server
#> vi /etc/sysconfig/vncservers

VNCSERVERS="1:root 2:dorbae"
VNCSERVERARGS[1]="-geometry 800x600"
VNCSERVERARGS[2]="-geometry 800x600"

2.2. Set VNC Password
#> su - dorbae
$> vncpasswd
(set password)
$> cd ~/.vnc
$> ls passwd

3. Start/Stop VNC-Server

#> service vncserver start
#> service vncserver stop
#> chkconfig vncserver on

Friday, 29 January 2016

[Linux] How to Increase the size of LVM by adding a new disk

1. Check New Disk Device

fdisk -l


2. Create Partition

  2.1. Select Device
fdisk /dev/xvdb

  2.2. New Partition
Command (m for help): n

  2.3. Continue...
Command action
   e   extended
   p   primary partition (1-4)
p

Partition number (1-4): 1

First cylinder (1-2610, default 1): (enter)
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): (enter)

  2.4. Change to a partitions system ID
Command (m for help): t
Selected partition 1

Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

  2.5. Save
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

3. Create PV(Physical Volume)

pvcreate /dev/xvdb1



4. Extend VG(Volume Group)
vgdisplay


vgextend VolGroup /dev/xvdb1


pvscan


5. Extend LV(Logical Volume)

lvdisplay
































lvextend /dev/VolGroup/lv_home /dev/xvdb1


6. Resize File System

resize2fs /dev/VolGroup/lv_home




Before Extention



After Extention



[Xen] How to Add Hard Disk as Storage Repository Using XE Command

1. Check New Hard Disk

fdisk -l











2. Create SR

xe sr-create name-label=<Name of Storage> shared=false device-config:device=<Path of the Storage device> type=lvm


this command returns Storage Repository UUID.

[CentOS] /etc/sysconfig/network

The /etc/sysconfig/network file is used to specify information about the desired network configuration. The following values may be used:

NETWORKING=<value>
    where <value> is one of the following boolean values:
yes — Networking should be configured.
no — Networking should not be configured.

HOSTNAME=<value>
  where <value> should be the Fully Qualified Domain Name (FQDN), such as hostname.expample.com, but can be whatever hostname is necessary.

GATEWAY=<value>
    where <value> is the IP address of the network's gateway.

GATEWAYDEV=<value>
    where <value> is the gateway device, such as eth0. Configure this option if you have multiple interfaces on the same subnet, and require one of those interfaces to be the preferred route to the default gateway.

NISDOMAIN=<value>
    where <value> is the NIS domain name.

NOZEROCONF=<value>
    where setting <value> to true disables the zeroconf route.

[Java] When Command in Runtime.getRuntime().exec is Not Working

try {
    Runtime.getRuntime().exec( "echo Hello > test.txt");

} catch ( IOException e) {
    e.printStackTrace();
}

If does not occur Exception and command is not working,

For Linux
try {
    Runtime.getRuntime().exec( new String[] { "/bin/sh", "-c", "echo Hello > test.txt"});

} catch ( IOException e) {
    e.printStackTrace();
}
For Windows
try {
    Runtime.getRuntime().exec( new String[] { "cmd.exe", "/c", "echo Hello > test.txt"});

} catch ( IOException e) {
    e.printStackTrace();
}

Friday, 22 January 2016

[RCP] How to set workspace location in Eclipse RCP (이클립스 RCP Workspace 설정)

Eclipse Framework은 Workspace location에 Framework에 필요한 다양한 정보들은 저장 및 로드한다. Eclipse RCP에서는 workspace location을 명시적으로 설정을 하지 않을 경우, User Directoryprogram 내에서 설정하기 위해서는
소스에서

In my Eclipse / RCP application the .metadata directory was always created in the working directory. This worked fine when I was opening the application normally.

However, I needed file associations, so the user can just double click on file somewhere on his computer and open the file.

If you do this, the working directory is set to the directory where the file is located. This resulted in the creation of a .metadata directy at the same location. Brrr...

Since I dont like the creation of .metadata in the working directory either, because thats usually the application folder and not writeable, this needed to be addressed anyway.

So I looked for a solution to change the workspace location for the application.

To achieve this, two steps are neccessary. First we add an additional parameter in the Run configuration:

The paramater is -data @noDefault and makes it possible for us to set up our own location.

Which we do in the *Application class of our application:



[ActiveMQ] Destination Wildcards

ActiveMQ에서는 계층적으로 Destination(Queue 또는 Topic)의 이름을 분리시키는 것을 지원한다.

[JDBC] java.sql.Types List

java.sql.Types Value
java.sql.Types.ARRAY 2003
java.sql.Types.BIGINT -5
java.sql.Types.BINARY -2
java.sql.Types.BIT -7
java.sql.Types.BLOB 2004
java.sql.Types.BOOLEAN 16
java.sql.Types.CHAR 1
java.sql.Types.CLOB 2005
java.sql.Types.DATALINK 70
java.sql.Types.DATE 91
java.sql.Types.DECIMAL 3
java.sql.Types.DISTINCT 2001
java.sql.Types.DOUBLE 8
java.sql.Types.FLOAT 6
java.sql.Types.INTEGER 4
java.sql.Types.JAVA_OBJECT 2000
java.sql.Types.LONGNVARCHAR -16
java.sql.Types.LONGVARBINARY -4
java.sql.Types.LONGVARCHAR -1
java.sql.Types.NCHAR -15
java.sql.Types.NCLOB 2011
java.sql.Types.NULL 0
java.sql.Types.NUMERIC 2
java.sql.Types.NVARCHAR -9
java.sql.Types.OTHER 1111
java.sql.Types.REAL 7
java.sql.Types.REF 2006
java.sql.Types.ROWID -8
java.sql.Types.SMALLINT 5
java.sql.Types.SQLXML 2009
java.sql.Types.STRUCT 2002
java.sql.Types.TIME 92
java.sql.Types.TIMESTAMP 93
java.sql.Types.TINYINT -6
java.sql.Types.VARBINARY -3
java.sql.Types.VARCHAR 12

Tuesday, 18 August 2015

[Apache Tajo] Apache Tajo SQL Language Reference

Apache Tajo에서 지원하는 SQL 문법 관련

http://tajo.apache.org/docs/devel/sql_language.html (영문)
http://hyunsik.github.io/tajo-doc-kr/docs/0.10.0/sql_language.html (한글)

[Apache Tajo] Apache Tajo JDBC Driver 0.10.1 Connection Issue

최근 들어서 Apache Tajo에 대한 테스트를 진행 중이다.

Tajo Desktop을 통해서 Tajo 설치 후에 JDBC Driver를 통해서 커넥션 및 Read/Write에 대한 테스트를 진행 중 한 가지 문제를 만났다.

Connection 후 Select나 Meta 정보를 가져오는 과정에서 com.google.protobuf.ServiceException: giving up after tries=2 와 같은 에러가 발생.

구글링 해보니 google protobuf libarary에 대한 문제 제기가 많았다. 그런데 0.10.0 버전부터 필요한 라이브러리들을 JDBC Driver에 포함시킨 걸로 알고 있다. 실제로 jar 파일 열어보면 그렇고.

그래서 Tajo 가 설치된 서버에서 netstat을 통해서 포트를 확인해보니, 제가 지정해주 26002 포트가 Loopback으로 올라와 있었다. 당연히 연결에서 오류가 났어야하는데...

해서 포트를 36002, 9999 등 연관 없는 포트번호를 줘도 Connection 하는 과정에서 Exception이 발생.

혹시나해서 IP 주소도 Tajo가 설치되지 않은 서버 IP를 주어도 마찬가지, 심지어 실제로 해당 IP를 갖는 서버가 없음에도 Connection 하는 과정에서 Exception이 발생하지 않았다.

실제 연결이 이뤄지지 않은 상태에서 통신이 이뤄질려고 하다보니 google protobuf 쪽에서 Exception이 발생하지 않았나 싶다.

아직 Apache Tajo에 대한 충분한 이해없이 진행하다보니 문제가 아닌점에서 문제를 느낄 수도 있으나, 상식적으로 잘 이해가 가지 않는 부분이다.

제대로 살펴볼 필요가 있다.

Wednesday, 17 June 2015

[RCP] Main Toolbar에서 Separator 보이지 않는 현상(Eclipse RCP toolbar separators don't show up)




다음과 같이 Toolbar Commands 사이에 Separator를 추가해주고 
visible 옵션을 true로 주었는데


다음과 같이 Separator가 보이지 않는 현상이 발생했다.
Eclipse 4.3, 4.4 버전에서 발생하는 것으로 봐서 e4 환경의 Eclipse에서 RCP 3.x 프로그램을 구현하면서 생기는 버그인 듯 하다.

아래 내용 참조
https://bugs.eclipse.org/bugs/show_bug.cgi?id=413213