Sample program that transfers data from MySQL to Oracle (CLOB)

Table structure in Oracle SQL> desc scott.oracletable; Name Null? Type ----------------------------------------- -------- ---------- TRANSDATE NOT NULL DATE SEQUENCE_NO NOT NULL NUMBER(6) LOBDATA NOT NULL CLOB Table structure in MySQL: Name Type ----------------------------------------- -------- trandate Date sequence_no smallint(6) textfield longtext -- Code: import java.sql.*; import*; import java.lang.StringBuffer; import java.util.Date; import java.text.SimpleDateFormat; public class TransferMySQLToOracle... Continue Reading →


Sample JDBC program which connects to Oracle

Sample program that demonstrates using JDBC to connect to Oracle database. Source code $ cat import java.sql.*; public class TestConnection { public static void main (String args []) throws SQLException, InterruptedException { DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); java.util.Properties props = new java.util.Properties(); // user/password@host:port:SID Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:" + args[0] + "/" + args[1] +... Continue Reading →

MySQL – JDBC connection example

----- ---- ---- To compile c:> javac ---- Note: Make sure the CLASSPATH env is set. MySQL Connnector/J can be downloaded from ---- Example: CLASSPATH=mysql-connector-java-5.1.7\mysql-connector-java-5.1.7-bin.jar;. ---- To run c:> java Connect --- code import java.sql.*; public class Connect { public static void main(String argv[]) throws Exception { Connection conn = null;... Continue Reading →

Blog at

Up ↑