[Building Sakai] Updating SQL database directly

Nguni Phakela nguni52 at gmail.com
Wed Jan 30 01:02:11 PST 2013


Hi,

I have the following code to update a table:

conn = dataSource.getConnection();
String updateString = "update SAKAI_USER_ID_MAP set EID = ?  where USER_ID
= ?";
PreparedStatement updateOptions = conn.prepareStatement(updateString);

System.out.println(updateOptions.toString());

updateOptions.setString(1, studentNumber);
updateOptions.setString(2, user.getId());

System.out.println(updateOptions.toString());

int rowsUpdated = updateOptions.executeUpdate();

System.out.println("Number of rows updated: " + rowsUpdated);


I'm getting the following output:
com.mysql.jdbc.JDBC4PreparedStatement at 77c03963: update SAKAI_USER_ID_MAP
set EID = ** NOT SPECIFIED **  where USER_ID = ** NOT SPECIFIED **
com.mysql.jdbc.JDBC4PreparedStatement at 77c03963: update SAKAI_USER_ID_MAP
set EID = 'xxxxxx'  where USER_ID = 'xxxxxxxxx-d0fb-4824-aa45-f65e5ecad515'

The executeUpdate() seems to not be executing, and the printout for the
number of rows updated
also seems to not be executing.

What could I be missing?

Cheers

-- 
Nguni Phakela
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20130130/e087daea/attachment.html 


More information about the sakai-dev mailing list