My linux world » Java Survival Guide

Java Survival Guide


Contents

Installation

Download java version from here
Note : we will use this one : jdk-6u43-linux-x64.bin

Install it:

chmod a+x jdk-6u43-linux-x64.bin
./jdk-6u43-linux-x64.bin

Configuration

Add to your ~/.bashrc the following environment var:

export JAVA_OPTS=”-Xms1024m -Xmx1024m -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled"
export JAVA_HOME=/opt/java/jdk1.6.0_43
export PATH=$PATH:$JAVA_HOME/bin

And reload your shell:

source ~/.bashrc

Check all is ok:

java -version

JDBC URLs

Mysql (Connector/J)

* Driver Class: com.mysql.jdbc.Driver
* Default Port: 3306
* JDBC URL : jdbc:mysql://[host][,failoverhost…][:port]/[database]

PostgreSQL

* Driver Class: org.postgresql.Driver
* Default Port: 5432
* JDBC URL : jdbc:postgresql://host:port/database?user=userName&password=pass

Microsoft SQL Server (jTDS Driver)

* Driver Class: net.sourceforge.jtds.jdbc.Driver
* Default Port: 1433
* JDBC URL : jdbc:jtds:sqlserver://server/db;user=userName;password=password

Microsoft SQL Server (Microsoft Driver)

* Driver Class: com.microsoft.jdbc.sqlserver.SQLServerDriver
* Default Port: 1433
* JDBC URL : jdbc:microsoft:sqlserver://host:port;databasename=name;user=yourUser;password=yourPwd

Oracle

* Driver Class: oracle.jdbc.driver.OracleDriver
* Default Port: 1521
* JDBC URL : jdbc:oracle:thin:@server:port:databasename;user=userName;password=password


Copyright © 2023 My linux world - by Marc RABAHI
Design by Marc RABAHI and encelades.

Fork me on GitHub