[Building Sakai] Jforum 2.6.4 and Oracle

Stephen Jaegle sjaegle at gmail.com
Mon Aug 24 15:56:44 PDT 2009


Hi all:

Some followup information: it turns out that the tables appear to have the
appropriate fields, but two statements for oracle in
jforum-tool/src/webapp/WEB-INF/config/database/oracle/oracle.sql do not
match the variable bindings in
jforum-tool/src/java/org/etudes/jforum/dao/generic/GenericUserDAO.java.

In the addNew method we have:
	    PreparedStatement p =
this.getStatementForAutoKeys("EvaluationModel.addNew");
		p.setInt(1, evaluation.getGradeId());
		p.setInt(2, evaluation.getUserId());
		p.setString(3, evaluation.getSakaiUserId());
		if (evaluation.getScore() == null)
			p.setNull(4, Types.FLOAT);
		else
			p.setFloat(4, evaluation.getScore());
		p.setString(5, evaluation.getComments());
		p.setInt(6, evaluation.getEvaluatedBy());
		p.setTimestamp(7, new Timestamp(System.currentTimeMillis()));
but the SQL is:
EvaluationModel.addNew = INSERT INTO jforum_evaluations(evaluation_id,
grade_id, user_id, sakai_user_id, score, comments, evaluated_by,
evaluated_date) VALUES (jforum_evaluations_seq.nextval, ?, ?, ?, ?,
EMPTY_CLOB(), ?, ?)

Replacing the EMPTY_CLOB() with a '?' seems to work fine, at least with the
ojdbc14.jar we are using.

In the update method we have:
		PreparedStatement p =
JForum.getConnection().prepareStatement(SystemGlobals.getSql("EvaluationModel.update"));
		if (evaluation.getScore() == null)
			p.setNull(1, Types.FLOAT);
		else
			p.setFloat(1, evaluation.getScore());
		p.setString(2, evaluation.getComments());
		p.setInt(3, evaluation.getEvaluatedBy());
		p.setTimestamp(4, new Timestamp(System.currentTimeMillis()));
		p.setInt(5, evaluation.getId());
but the SQL is:
EvaluationModel.update = UPDATE jforum_evaluations SET score = ?,
evaluated_by = ?, evaluated_date = ? WHERE evaluation_id = ?

Here, inserting 'comments = ?' between 'score = ?' and 'evaluated_by = ?'
appears to work.

Thanks,

Steve


Stephen Jaegle wrote:
> 
> Hi all:
> 
> I just installed JForum 2.6.4 in a test instance connected to Oracle (10g,
> I believe), and it appears to be running properly for the most part. I was
> able to access the configure screen and users can post and read messages.
> When the update button is clicked when grading a message, a sql exception
> occurs.
> ...
> ERROR: an error occured in JForum.service():
> java.lang.reflect.InvocationTargetException (2009-08-21 19:55:13,124
> http-8080-Processor23_org.etudes.jforum.JForum)
> java.lang.reflect.InvocationTargetException
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> ...
> Caused by: 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.setTimestampInternal(OraclePreparedStatement.java:7629)
> 	at
> oracle.jdbc.driver.OraclePreparedStatement.setTimestamp(OraclePreparedStatement.java:7603)
> 	at
> org.apache.commons.dbcp.DelegatingPreparedStatement.setTimestamp(DelegatingPreparedStatement.java:144)
> 	at
> org.etudes.jforum.dao.generic.GenericEvaluationDAO.addNew(GenericEvaluationDAO.java:103)
> 	at
> org.etudes.jforum.view.forum.GradeAction.evaluateForumUser(GradeAction.java:921)
> 	... 48 more
> 

-- 
View this message in context: http://www.nabble.com/Jforum-2.6.4-and-Oracle-tp25089454p25123882.html
Sent from the Sakai - Development mailing list archive at Nabble.com.



More information about the sakai-dev mailing list