This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Using Oracle DataSource

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I set up JForum to use an Oracle DataSource that I configured in Tomcat. It's definitely connecting to Oracle, but when I create a new post to my forum, it blows up. The problem is that there seems to be some confusion between the Java class that runs the query and the query that it's using.

I get this stack trace:
Caused by: net.jforum.exceptions.DatabaseException: java.sql.SQLException: Invalid column index
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:5360)
at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:5352)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:131)
at net.jforum.dao.generic.GenericPostDAO.addNewPostText(GenericPostDAO.java:311)
at net.jforum.dao.generic.GenericPostDAO.addNew(GenericPostDAO.java:291)

I'm not sure which sql it's running, but the oracle.sql file specifies only two parameters to the query; GenericPostDAO attempts to set 3. I'm guessing it should be using OraclePostDAO instead of GenericPostDAO.

I have
database.driver.name=oracle
in oracle.properties, jforum-custom.conf, and oracle.properties.

I ran install.jsp first, and it had the same error when that tried to create an "initial" post to the default forum or something. So I blew the tables away and did a manual install.

Any suggestions?
[originally posted on jforum.net by bazoople]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wait I appear to have found the problem; jforum-custom.conf was missing this:

dao.driver=net.jforum.dao.oracle.OracleDataAccessDriver

I think that might be a bug in the install script.
[originally posted on jforum.net by bazoople]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use oracle as DB, too. But i dont have this problem.
My jforum-custom.conf also has dao.driver=net.jforum.dao.oracle.OracleDataAccessDriver.
[originally posted on jforum.net by william]
 
Paper beats rock. Scissors beats tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic