If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back  dBforums > Database Server Software > Sybase > Sybase error

LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Registered User
Join Date: Nov 2012
Posts: 2
Sybase error

We have a web application which uses Sybase as DB. Recently we found one error in the tomcat logs, which is printed in lacs of lines. The error was,

-ERROR- JDBCDatabase.get: Attempt to access a database connection that has not been made. JDBCDatabase.login must first be called to get a connection.
-ERROR- JDBCDatabase.getObjectField: No fields can be returned from this method because no query results exist to be retrieved. A query must first be executed through this class and then the get method must be called to reference a row of the query results before this method can be called.

Could you plz let me know why this error is getting generated?
Reply With Quote
  #2 (permalink)  
Registered User
Join Date: Jan 2004
Location: The Hague/Utrecht, NL
Posts: 503
According to the first line there is no connection with the database. You cannot acces a database when you have no connection.
Check your code if all the necessary commands are given. Connect, login, open db, etcetera.
I'm not crazy, I'm an aeroplane!
Reply With Quote
  #3 (permalink)  
Registered User
Join Date: Oct 2012
Posts: 8

You can open connection java to ASE using jConnect Driver as below :
After that Run your code.

If you need help regarding jconnect configuration , please check Jconnect Config Link :

[sybase@localhost ~]$ cat JdbcTest.java
import java.sql.* ;
public class JdbcTest
public static void main( String args[] )
Class.forName( “com.sybase.jdbc3.jdbc.SybDriver” ) ;
Connection conn = DriverManager.getConnection( “jdbc:sybase:Tds:localhost.localdomain:5000″, “sa”, “”) ;
Statement stmt = conn.createStatement() ;
ResultSet rs = stmt.executeQuery( “SELECT * FROM master..sysdatabases” ) ;
while( rs.next() )
System.out.println( rs.getString(1) ) ;
rs.close() ;
stmt.close() ;
conn.close() ;
catch( Exception e )
{ System.out.println( e ) ; }
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On