Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Posts
    12

    Unanswered: Example of a JDBC connection

    Hi everybody,

    Does anyone have an example of a connection using the jdbc driver for informix?

    thanks

  2. #2
    Join Date
    Feb 2005
    Posts
    5

    Informix Jdbc

    import java.sql.*;
    import java.util.*;

    public class Connect
    {
    public static void main(String[] args)
    {
    Connection conn = null;
    String url = "jdbc:informix-sqli://123.45.67.89:1533:INFORMIXSERVER=myserver;user=rdt est;password=test",

    try
    {
    Class.forName("com.informix.jdbc.IfxDriver");
    System.out.println("Driver OK");
    }
    catch (Exception e)
    {
    System.out.println("FAILED: failed to load Informix JDBC driver.");
    }

    try
    {
    conn = DriverManager.getConnection(url);
    }
    catch (SQLException e)
    {
    System.out.println("FAILED: failed to connect!"+e);
    }

    }
    }

  3. #3
    Join Date
    Oct 2012
    Posts
    1

    additional parameters

    it might be additional parameters that your DB will required for let you connect into , these parameters should be added to the URL , for example:

    jdbc:informix-sqli://10.6.1.9:1512/prod28:INFORMIXSERVER=hp17_jdevolo_tcp;DB_LOCALE=i w_il.8859-8;CLIENT_LOCALE=iw_il.8859-8;IFX_ISOLATION_LEVEL=3U;IFX_LOCK_MODE_WAIT=10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •