<div>I am using MS SQL 2003. What changes should I do to this code? I have created a table within opencms database. I would like to read/write/update to this table.</div> <div> </div> <div>Thanks</div> <div> </div> <div>-Twinkle<BR><BR><B><I>Joe Desbonnet <jdesbonnet@gmail.com></I></B> wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">You can create your own database pool:<BR><BR>1. Edit opencms.properties and add the following block (and replace<BR>"mydbpool", "mydbname","mydbuser","mydbpassword" as appropriate). This<BR>assumes you are using MySQL
database.<BR><BR>db.pool.mydbpool.jdbcDriver=org.gjt.mm.mysql.Driver<BR>db.pool.mydbpool.jdbcUrl=jdbc:mysql://my.db.server.com:3306/mydbname<BR>db.pool.mydbpool.jdbcUrl.params=<BR>db.pool.mydbpool.user=mydbuser<BR>db.pool.mydbpool.password=mydbpassword<BR>db.pool.mydbpool.poolUrl=opencms:mydbpool<BR>db.pool.mydbpool.maxActive=25<BR>db.pool.mydbpool.maxWait=2000<BR>db.pool.mydbpool.maxIdle=10<BR>db.pool.mydbpool.testQuery=<BR>db.pool.mydbpool.whenExhaustedAction=block<BR>db.pool.mydbpool.testOnBorrow=false<BR><BR>2. In the same file (opencms.properties) locate key "db.pools" and add your<BR>pool name (it's a comma separated list)<BR>eg<BR>db.pools=default,mydbpool<BR><BR>3. Restart Opencms/Tomcat. You should now be able to access<BR>connections from your pool.<BR><BR>Eg using JSP code like this:<BR><BR><%<br>java.sql.Connection connection =<br>OpenCms.getSqlManager().getConnection("mydbpool");<br>String sql = "SELECT name FROM jhl_department WHERE id=" +
deptId;<br>ResultSet rs = connection.createStatement().executeQuery(sql);<br>... etc ... etc<br><br>rs.close();<br>connection.close();<br>%><BR><BR><BR>Joe.<BR><BR>On 4/4/06, Zotter Christian <CHRISTIAN.ZOTTER@OEPAG.AT>wrote:<BR>><BR>> Hello to all,<BR>><BR>> I want to include a page with a simple HTML form and submit the data to the<BR>> a self designed table of the database.<BR>> Does OpenCms provide classes for accessing the database? Is there a tutorial<BR>> or documentation existing how to do this?<BR>> I did not find a useful documentation how to do this best till now.<BR>><BR>> Thanks, Christian (OpenCms beginner)<BR>><BR>><BR>><BR>> _______________________________________________<BR>> This mail is sent to you from the opencms-dev mailing list<BR>> To change your list options, or to unsubscribe from the list, please visit<BR>>
http://lists.opencms.org/mailman/listinfo/opencms-dev<BR>><BR>><BR><BR>_______________________________________________<BR>This mail is sent to you from the opencms-dev mailing list<BR>To change your list options, or to unsubscribe from the list, please visit<BR>http://lists.opencms.org/mailman/listinfo/opencms-dev<BR></BLOCKQUOTE><BR><p>
<hr size=1>Yahoo! Messenger with Voice. <a href="http://us.rd.yahoo.com/mail_us/taglines/postman1/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com">Make PC-to-Phone Calls</a> to the US (and 30+ countries) for 2¢/min or less.