Results 1 to 2 of 2

Thread: jdbc and view

  1. #1
    Join Date
    Nov 2003
    Posts
    2

    Unanswered: jdbc and view

    Hi

    I have a problem with jdbc and views. My Java-Code is:

    ...
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:"+dbName, usr, pass);
    String Query = "SELECT * FROM test";
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(Query);
    ...

    test is a view on my Microsoft SQL Server DB.
    I got the Error:
    java.sql.SQLException: [Microsoft][ODBC
    SQL Server Driver][SQL Server]Invalid object name 'test'


    If the Query is: "SELECT * FROM myTable" everything is fine...

    any ideas...

    thanks in advance

  2. #2
    Join Date
    Nov 2003
    Posts
    2

    Re: jdbc and view

    i found the error

    thanks...

Posting Permissions

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