[Building Sakai] problem org.sakaiproject.tool.api.ToolException: Exception in JSP:
Aaron Zeckoski
aaronz at vt.edu
Sat May 16 20:28:09 PDT 2009
Here is a tool (sample code) which uses JDBC and JSP and gets some
data from the sakai user table. Normally, you should really be using
the UserDirectoryService to get user data but I assume this was just a
proof of concept.
Just build this tool and place it into your sakai install to try it out.
Hope this helps.
-AZ
On Sat, May 16, 2009 at 12:13 PM, menjuanpablo <menjuanpablo at gmail.com> wrote:
>
> hi,
>
> I'm connecting my application with data base use JDBC spring, but this
> creates a exception in a jsp, in my class the conection is
>
> private DataSource dataSource;
>
> public void setDataSource(DataSource dataSource) {
> this.dataSource = dataSource;
> }
>
> public String SQL () throws SQLException{
> Connection conn = dataSource.getConnection();
> String sql="select FIRST_NAME from SAKAI_USER";
> try {
> Statement st= conn.createStatement();
> ResultSet rs= st.executeQuery(sql);
> name=rs.getString(1);
> return name;
> // do things with your connection (select, insert, delete, etc.)
> } finally {
> conn.close();
> }
> and in the jsp page I take the name to show, help me, connection is the
> problem?
> --
> View this message in context: http://www.nabble.com/problem-with-jdbc-spring-tp23563454p23575293.html
> Sent from the Sakai - Development mailing list archive at Nabble.com.
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
>
--
Aaron Zeckoski (aaronz at vt.edu)
Senior Research Engineer - CARET - Cambridge University
[http://bugs.sakaiproject.org/confluence/display/~aaronz/]
Sakai Fellow - [http://aaronz-sakai.blogspot.com/]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hwjdbc.zip
Type: application/zip
Size: 13353 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090516/b8363bb9/attachment.zip
More information about the sakai-dev
mailing list