File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Exception  :java.sql.SQLException: Incorrect list format: 7 > 1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Exception  :java.sql.SQLException: Incorrect list format: 7 > 1" Watch "Exception  :java.sql.SQLException: Incorrect list format: 7 > 1" New topic
Author

Exception :java.sql.SQLException: Incorrect list format: 7 > 1

Sri Palem
Ranch Hand

Joined: Sep 12, 2009
Posts: 32
I am using Cache DB for my application.
I configured the drivers correctly and added CacheDB.jar too in my classpath. I dont know whats wrong with the connection information. Whenever i try connecting to Cache DB it is giving the above mentioned error. My code is as follows..

String url = "jdbc:Cache://<IP Address>:<Port>/<Namespace>";
Driver drv = (Driver) Class.forName("com.intersys.jdbc.CacheDriver").newInstance();
DriverManager.registerDriver(drv);
con = DriverManager.getConnection(url);

Did anyone faced the same issue, if yes please share with me and suggest the solution
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Please post the entire stack trace.

Where is the user name and password ? Drivers usually register themselves when called with Class.forName(). There may be no need to register the driver again. Are you able to connect via a JDBC supported SQL editor ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Sri Palem
Ranch Hand

Joined: Sep 12, 2009
Posts: 32
I am not using any SQL Editor for cache..

This is what i get in my console..

java.sql.SQLException: Incorrect list format: 7 > 1
at com.intersys.jdbc.SysList.eltLength(SysList.java:306)
at com.intersys.jdbc.SysList.getString(SysList.java:1355)
at com.intersys.jdbc.SysList.readServerEncoding(SysList.java:270)
at com.intersys.jdbc.CacheConnection.connect(CacheConnection.java:801)
at com.intersys.jdbc.CacheConnection.<init>(CacheConnection.java:262)
at com.intersys.jdbc.CacheDriver.connect(CacheDriver.java:171)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.misyshealthcare.cprweb.connector.cache.TestConnection.main(TestConnection.java:31)
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Check the namespace / User / Pass again. Are you sure that they are correct
Sri Palem
Ranch Hand

Joined: Sep 12, 2009
Posts: 32
I think for getting the connection object, only url is enough, username and password are not required. And i am giving correct URL only. But still getting the same exception. In case, if Username and password are wrong, it should show a message like Wrong username or wrong password. But i dont know why it is showing "Incorrect List format".
 
jQuery in Action, 2nd edition
 
subject: Exception :java.sql.SQLException: Incorrect list format: 7 > 1