Skip to Content
Author's profile photo Former Member

JAVA + Sybase ASE

Just for those who are going to start programming with Sybase ASE and JAVA, or those who want to test this great RDBMS.


Install a JAVA JDK.

You can use any IDE like Eclipse.

Install Sybase ASE, could be Developer Edition.

Create a project new JAVA Project then copy and paste the following code.

Code example:

package jdbc;
import java.sql.*;
import java.util.*;
public class Jdbc {
 public static void main(String[] args) {

      } catch (ClassNotFoundException cnfe){
        System.out.println("Could not find the JDBC driver!");
  Connection conn = null;
  try {
      conn = DriverManager.getConnection("jdbc:sybase:Tds:**HOST**:**PORT**/**DATABASE**","**USER**","**PASSWORD**");
      System.out.println("Connection done");
   Statement stmt = conn.createStatement();
   ResultSet rs = stmt.executeQuery( "SELECT * FROM **DATABASE**");
   System.out.println("ID \t Store \t Fecha");
         while ( ) ) {
           System.out.println( rs.getString("**COLUMN**")+"\t"+rs.getString("**COLUMN**")+"\t"+rs.getString("**COLUMN**") );
       } catch (SQLException sqle) {
         System.out.println("Could not connect");

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Pankaj K Pathak
      Pankaj K Pathak

      Hi Ricardo Barbieri

      getting exception for the driver

      "Could not find the JDBC driver!"

      , where I get the driver(jar file).

      Kindly provide the link and the instructions that where to put that.