facebook

Database Explorer and JDK 1.5.0_03

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #230689 Reply

    dbennett455
    Participant

    Evaluating myEclipse for our development team and can’t get Database Explorer to work with JDK 1.5.0_03.

    Tried jTDS and Opta200 drivers (MS-SQL) and keep getting the error “Error while trying to login to database”.

    Based on other posts, this seems to be a problem with JDK 1.5x, however, we need to use that for Tomcat 5.x support.

    Any ideas?

    {ws}\.metadata\.log reads….

    !ENTRY com.genuitec.eclipse.sqlexplorer 4 4 Jun 06, 2005 23:37:26.734
    !MESSAGE Error while trying to login to database
    !STACK 0
    java.sql.SQLException: Unable to create connection. Check your URL.
    at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:102)
    at com.genuitec.eclipse.sqlexplorer.actions.LoginProgress$A.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:595)

    #230703 Reply

    Riyad Kalla
    Member

    FYI: Tomcat 5.0.x does not need JDK 1.5, so I guess you meant Tomcat 5.5?

    Note that there are two VMs you specify, 1 is the VM you run MyEclipse with, the other VM is the one you run your app server with. So it is entirely possible for you to specify JDK 1.4.2_08 to run Eclipse, and still setup JDK 1.5.0_03 to run your app server.

    You will need to specify the -vm command line argument in your shortcut you use to start Eclipse like so:

    
    eclipse.exe -vm c:\j2sdk1.4.2_08\bin\javaw.exe -vmargs -Xms128m -Xmx256m
    
    #231078 Reply

    dbennett455
    Participant

    Thanks for the tip, however, I still cannot connect to any datasources with the DB Browser, I always get the error “Error while trying to connect to database :”. I have tried three different MS-SQL JDBC drivers and the MySQL connector/J.

    #231080 Reply

    Brian Fernandes
    Moderator

    dbennett,

    Do you just get a simple message box with “error connecting” or a large message box with an exception trace?

    Can you paste your connection string here – the exception log seems to indicate that it is malformed.
    Are you supplying the correct address:port and schema?

    Brian.

    #231085 Reply

    cecil143
    Member

    dbennett,

    I faced the similar problem yesterday… Either check the Database Name OR…
    Verify once the Connection String ( meaning the jdbc:oracle:thin:@HOSTNAME:1521:DATABASENAME ) — This is for ORACLE THIN DRIVER.

    I guess. This should help your cause. Or else tell me the Driver Details, I shall try to figure on that.

    Thanks,
    Cecil.C.

    #256988 Reply

    I just ran into this issue trying to connect to a SQL Server DB. We normally use Oracle, and don’t have any problems using the DB explorer with Oracle’s thin JDBC drivers, but when I try to connect to our SQL Server DB, I get the following error:

    !ENTRY com.genuitec.eclipse.sqlexplorer 4 4 2006-08-16 14:21:01.674
    !MESSAGE Error while trying to login to database 
    !STACK 0
    java.sql.SQLException: Unable to create connection. Check your URL.
        at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:102)
        at com.genuitec.eclipse.sqlexplorer.actions.LoginProgress$Login.run(LoginProgress.java:43)
        at java.lang.Thread.run(Thread.java:595)

    No strack trace or exception from the actual JDBC driver to let me know what’s going on. The following code works perfectly to do a test connection (actual host, schema, username and password removed):

    import java.sql.Connection;
    import java.sql.DatabaseMetaData;
    import java.sql.DriverManager;
    
    public class DBTest {
      public static void main(String[] args) {
        try {
          Class.forName("net.sourceforge.jtds.jdbc.Driver");
          Connection conn = DriverManager.getConnection("jdbc:jtds:sqlserver://HOST_NAME/SCHEMA_NAME"
                                                      , "USER_NAME"
                                                      , "PASS_WORD");
          DatabaseMetaData meta = conn.getMetaData();
          System.out.println("Successfully connected to " + meta.getDatabaseProductName()
                           + " version " + meta.getDatabaseProductVersion()
                           + " with " + meta.getDriverName()
                           + " version " + meta.getDriverVersion()
                           + " (JDBC version " + meta.getJDBCMajorVersion() + "." + meta.getJDBCMinorVersion() + ")");
        } catch (Throwable t) {
          t.printStackTrace();
        }
      }
    }

    It returns Successfully connected to Microsoft SQL Server version 08.00.2148 with jTDS Type 4 JDBC Driver for MS SQL Server and Sybase version 1.2 (JDBC version 3.0) so I know I’ve established a connection to the server. If I use the exact connection string, driver class and username/password in the DB explorer, it fails with the error above. I’ve definitely got jTDS installed and configured correctly, because I can connect to a different SQL Server host with no problem. The only real difference with the URL for the working connection (besides host, username, password) is that we use the domain authentication feature so we add ;domain=DOMAIN_NAME to the URL. Any insight would be very helpful.

    – Erik Mattheis

    #256991 Reply

    Forgot to add, I tried this using jTDS 1.2 on MyEclipse 4.1.1 on Eclipse 3.1.2 on Sun JDK 1.5.0_06 on Windows XP Pro SP2 and also using jTDS 1.2 on MyEclipse 5.0.1 on Eclipse 3.2 on Apple JDK 1.5.0_06 on Mac OS X 10.4.7 (PPC) with the same results.

    – Erik Mattheis

    #257011 Reply

    Haris Peco
    Member

    Please, check connection with example from Erik’s (IronDuck) post.

    Erik,
    You have tried your example on same machine with same parameter and it work from simple application and doesn’t work from MyEclipse ?

    Domain controller authentication can be problem in Sql server because you can connect to sql server with jdbc driver, only if your database is install with mixed authentication – jdbc driver can’t work with windows authentication
    (jtds or MS, all the same).

    Connection engine is same for jdk >= 1.4.2 and MyEclipse >= 4.1 and OS for Myeclipse isn’t important.
    You can check if your database listen on port which you set in url (1433 default, but some sql server have dynamic port and MyEclipse can’t work with dynamic port) and you have to have correct authentication method on sql server

    Best
    Peco

    #257143 Reply

    leaked
    Member

    Guys, this may or may not help, but I’ve seen similar messages when trying to use the “DEBUG” version of the Oracle JDBC drivers with “MyEclipse Database Explorer”. I simply replaced the drivers with the “NON-DEBUG” version and it fixed all my problems.

    #257662 Reply

    Sorry, I’m just getting back to this thread.

    Peco – Yes, the example works in a simple application, and not in MyEclipse. The parameters are identical as far as I can tell. Windows authentication DOES work with jTDS, you just have to pass the domain in the connection String. Check the SQL Server-Specific section of this page and the domain parameter on this page for details. Interestingly, the SQL Server I connect to with domain auth works under MyEclipse, but the one that uses server auth does not. SQL Server is definitely configured correctly, as I can connect just fine from my own Java applications, just not in MyEclipse.

    leaked – Thanks for the tip. I’ve never tried the debug drivers, and my Oracle connections all seem to work correctly in MyEclipse.

    – Erik Mattheis
    ironduck@mac.com

    #257681 Reply

    Brian Fernandes
    Moderator

    Erik,

    I apoligize in advance if I have missed some context here. Have you tried using the Microsoft SQL Server JDBC driver and not jTDS? (Is there a particular reason why you must use jTDS?)
    I agree that if the jTDS driver works with the sample program, it should have no problems working with MyEclipse as well; we will be taking a closer look at his – but I’d like to see what happens with the Microsoft driver, if possible.

    Best,
    Brian.

    #257743 Reply

    Riyad Kalla
    Member

    For a tip on getting Windows Authentication working with MS SQL Server and the MS JDBC driver, see this new tip: http://www.myeclipseide.com/index.php?name=PNphpBB2&file=viewtopic&p=64328#64328

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: Database Explorer and JDK 1.5.0_03

You must be logged in to post in the forum log in