just so people know... i'm not making a storm in a glass... if you come to a forum is to get the knowledge from others and heck if i knew how to do it i would just tell you what you need not just blur out comments like this...
"Lazy multi-cross-posting idjit. I've answered this question for you twice (without code), but rather than ask questions about the implementation of it, and doing some (God forbid) work for your self, you come back again, whining and begging for others to do it for you. Even if someone does, once it is all said and done, what will you have gained? You still wouldn't undersstand it and at the first sign of trouble would simply come back and whine and beg again for someone to fix it for you.
God but I'm getting tired of this "just shut up and do it for me" attitude (even if it was expressed somewhat diplomatically this time, it's still the same attitude). "
masijade or whatever, people come to forums to learn, there is no substitution for a good book, but people come to forums to not just learn but also pass or do knowledge transfer, people who are experienced like to teach, and are not arrogant like you expressing attitudes that i may or may not have, i posted in all forums my doubts as i needed a fast answer, and i do thank you for your response in another Forum but there is no reason start your experiences if you are frustrated then just don't plug in your computer, if you don't want to help than just don't say anything people who want to make it like Ronillo he helped me because maybe this interested him and like to go down and program it... he didn't make it for me he explained it and passed down his knowledge of writing code... and he expressly stated this is not right!! you didn't see him cry about other people not knowing to code... if you are experienced which i think you are and just don't want to help people just stay out of forums why do you come here??? to laugh at people that know how to code??? this is not the intent of a forum... not just mouth of or whine of others... and just to shut your mouth up... i made it.... i finished my code... as i don't care much for you or your comments here is the code that you or others that think that doing code for others is not are responsibility and i as i told Flounder i will make it... just help me create the first one...
Thanx for expressing your true sentiments of forums you arrogant buffoon, i would like to see you when you post a message stating that you don't know something...
package Connecting;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Connection;
import java.io.*;
import java.sql.CallableStatement;
import oracle.jdbc.driver.OracleConnection;
import com.sybase.jdbcx.*;
import com.sybase.jdbc3.tds.*;
import com.sybase.jdbc3.jdbc.*;
import com.sybase.jdbc3.timedio.*;
import com.sybase.jdbc3.utils.*;
import java.util.*;
public class SybaseConnector {
Connection o_Connection = null;
Statement o_Statement = null;
ResultSet o_ResultSet = null;
Connection s_Connection = null;
Statement s_Statement = null;
ResultSet s_ResultSet = null;
CallableStatement proc = null;
String o_Driver = "oracle.jdbc.driver.OracleDriver";
String o_Url = "jdbc

racle:thin:@198.162.1.103:1521/Test";
String s_Driver = "com.sybase.jdbc3.jdbc.SybDataSource";
String s_Url = "jdbc:sybase:Tds:198.162.1.103:5000/Test_MF";
//198.162.1.103
public SybaseConnector() {
//Load driver
try {
Class.forName(o_Driver);
Class.forName(s_Driver);
System.out.println("Driver for Oracle loaded Successfully");
System.out.println("Driver for Sybase loaded Successfully");
}
catch (ClassNotFoundException ex) {
System.out.println("Oracle Driver was not loaded successfully");
System.out.println("Sybase Driver was not loaded successfully");
ex.printStackTrace();
}
}
public void doWork() {
String query = "";
String inserting ="";
//String execute = "";
//String create = "";
try {
//Create connection object
o_Connection = DriverManager.getConnection(o_Url, "system", "9876");
System.out.println("Connected to Oracle Successfully");
s_Connection = DriverManager.getConnection(s_Url, "sa", "");
System.out.println("Connected to Sybase Successfully");
//Create Statement String objects
query = "SELECT * FROM Employee";
inserting = "Insert INTO EmpTest Values (?,?,?,?,?)";
//Execute the query
s_Statement = s_Connection.createStatement();
s_ResultSet = s_Statement.executeQuery(query);
//PreparedStatement ps_Statement;
PreparedStatement ps_Statement = o_Connection.prepareStatement(inserting);
//Loop through the results
while (s_ResultSet.next()) {
System.out.print(s_ResultSet.getString(1) + " " + s_ResultSet.getString(2) + " " + s_ResultSet.getString(3) + " " + s_ResultSet.getString(4) + " " + s_ResultSet.getString(5)+"\n");
for(int i = 1;i < 6;i++) {
ps_Statement.setString(i, s_ResultSet.getString(i));
}
ps_Statement.executeUpdate();
ps_Statement.clearParameters();
//o_Statement.executeQuery(inserting + s_ResultSet.getString(1) + ", " + s_ResultSet.getString(2) + ", " + s_ResultSet.getString(3) + ", " + s_ResultSet.getString(4) + ", " + s_ResultSet.getString(5) + ")");
System.out.println("Values Inserted Correctly");
}
} catch (SQLException ex) {
ex.printStackTrace();
System.out.println(ex);
} finally {
try {
if (o_ResultSet != null)
o_ResultSet.close();
if (s_ResultSet != null)
s_ResultSet.close();
if (o_Statement != null)
o_Statement.close();
if (s_Statement != null)
s_Statement.close();
if (o_Connection != null)
o_Connection.close();
if (s_Connection != null)
s_Connection.close();
} catch (SQLException ex) {
ex.printStackTrace();
System.out.println(ex);
}
}
}
public static void main(String[] args) {
SybaseConnector Test = new SybaseConnector();
Test.doWork();
}
}