Volcity Database Query

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Volcity Database Query

Mr. Christopher Falzone
I know at some point I've seen the ability to query databases with
velocity. It looked something like:

#set ($dbConnection = 'jdbc/myconnection')
#getSQLResults('select * from myTable')

<p>$SQLError</p>

#foreach($row in $results)
   $row.field
#end


1.  Is there documentation on this somewhere?  I can't seem to find it
atm.

2.  How do I setup "jdbc/myconnection".  I'm not very familiar with
how that all works.  I know it's a java thing, and is probably defined
in an xml file somewhere.

Thanks,
Christopher Falzone
Edinboro University of PA




dotCMS: Opensource CMS goodness.
http://www.dotcms.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/dotcms/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/dotcms/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 
Reply | Threaded
Open this post in threaded view
|

Re: Volcity Database Query

Jason Tesser-2
Well you can set up the datasource in the server.xml or in the
ROOT.xml if running latest stable and tomcat 6.

http://dotcms.org/documentation/tips_tricks.dot#SQLQuery

On Jan 24, 2008 10:34 AM, ctiggerf <[hidden email]> wrote:

>
>
>
>
>
>
> I know at some point I've seen the ability to query databases with
>  velocity. It looked something like:
>
>  #set ($dbConnection = 'jdbc/myconnection')
>  #getSQLResults('select * from myTable')
>
>  <p>$SQLError</p>
>
>  #foreach($row in $results)
>  $row.field
>  #end
>
>  1. Is there documentation on this somewhere? I can't seem to find it
>  atm.
>
>  2. How do I setup "jdbc/myconnection". I'm not very familiar with
>  how that all works. I know it's a java thing, and is probably defined
>  in an xml file somewhere.
>
>  Thanks,
>  Christopher Falzone
>  Edinboro University of PA
>
>  



--
Jason Tesser
dotmarketing, Lead Programmer
1-305-858-1422


dotCMS: Opensource CMS goodness.
http://www.dotcms.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/dotcms/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/dotcms/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 
Reply | Threaded
Open this post in threaded view
|

Re: Volcity Database Query

Mr. Christopher Falzone
Thanks Jason,

I know we had talked about it before .. just couldn't remember where it
was.

Also, I started to plug this in, but ran into the same stumbling block I
had setting up the MSSQL DB for DotCMS.  The problem was that we had
installed the dotcms DB into a named instance.  The only way we finally
got around that was putting it onto a default instance.

So ... Does anyone know how to define the URL for a named instance that
runs on a random range of ports?  This particular database is running on
a machine named "mahagony" on an instance named "tac" and in a db name
"webkeywords".  My initial thought was:

<Resource name="jdbc/WebKeyword" auth="Container"
type="javax.sql.DataSource"
  maxActive="100" maxIdle="30" maxWait="10000"
  username="dotCMSUser" password="..."
driverClassName="net.sourceforge.jtds.jdbc.Driver"
  url="jdbc:jtds:sqlserver://mahogony/tac/dotcms"/>

Any thoughts?

Christopher F. Falzone
Technology & Communications
Edinboro University
(814) 732-1080
[hidden email]
http://www.edinboro.edu

Great Things Happen Here!



Jason Tesser wrote:

>
> Well you can set up the datasource in the server.xml or in the
> ROOT.xml if running latest stable and tomcat 6.
>
> http://dotcms.org/documentation/tips_tricks.dot#SQLQuery 
> <http://dotcms.org/documentation/tips_tricks.dot#SQLQuery>
>
> On Jan 24, 2008 10:34 AM, ctiggerf <[hidden email]
> <mailto:cfalzone%40edinboro.edu>> wrote:
> >
> >
> >
> >
> >
> >
> > I know at some point I've seen the ability to query databases with
> > velocity. It looked something like:
> >
> > #set ($dbConnection = 'jdbc/myconnection')
> > #getSQLResults('select * from myTable')
> >
> > <p>$SQLError</p>
> >
> > #foreach($row in $results)
> > $row.field
> > #end
> >
> > 1. Is there documentation on this somewhere? I can't seem to find it
> > atm.
> >
> > 2. How do I setup "jdbc/myconnection". I'm not very familiar with
> > how that all works. I know it's a java thing, and is probably defined
> > in an xml file somewhere.
> >
> > Thanks,
> > Christopher Falzone
> > Edinboro University of PA
> >
> >
>
> --
> Jason Tesser
> dotmarketing, Lead Programmer
> 1-305-858-1422
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: Volcity Database Query

Jason Tesser-2
Well you will need to make sure that the instance is listening on the
same port.  you can set the port after the host with host:port

if you do not set the port the default port is used. But if you are
going to connect to a db or a service generally you need an ip and a
port.  in this case those ports cannot be random.

On Jan 24, 2008 11:47 AM, Christopher F. Falzone <[hidden email]> wrote:

>
>
>
>
>
>
>  Thanks Jason,
>
>  I know we had talked about it before .. just couldn't remember where it
> was.
>
>  Also, I started to plug this in, but ran into the same stumbling block I
> had setting up the MSSQL DB for DotCMS.  The problem was that we had
> installed the dotcms DB into a named instance.  The only way we finally got
> around that was putting it onto a default instance.
>
>  So ... Does anyone know how to define the URL for a named instance that
> runs on a random range of ports?  This particular database is running on a
> machine named "mahagony" on an instance named "tac" and in a db name
> "webkeywords".  My initial thought was:
>
>  <Resource name="jdbc/WebKeyword" auth="Container"
> type="javax.sql.DataSource"
>    maxActive="100" maxIdle="30" maxWait="10000"
>    username="dotCMSUser" password="..."
> driverClassName="net.sourceforge.jtds.jdbc.Driver"
>    url="jdbc:jtds:sqlserver://mahogony/tac/dotcms"/>
>
>  Any thoughts?
>
>  Christopher F. Falzone
> Technology & Communications
> Edinboro University
> (814) 732-1080
> [hidden email]
> http://www.edinboro.edu
>
> Great Things Happen Here!
>
>
>
>  Jason Tesser wrote:
>
>
>
> Well you can set up the datasource in the server.xml or in the
>  ROOT.xml if running latest stable and tomcat 6.
>
>  http://dotcms.org/documentation/tips_tricks.dot#SQLQuery
>
>  On Jan 24, 2008 10:34 AM, ctiggerf <[hidden email]> wrote:
>  >
>  >
>  >
>  >
>  >
>  >
>  > I know at some point I've seen the ability to query databases with
>  > velocity. It looked something like:
>  >
>  > #set ($dbConnection = 'jdbc/myconnection')
>  > #getSQLResults('select * from myTable')
>  >
>  > <p>$SQLError</p>
>  >
>  > #foreach($row in $results)
>  > $row.field
>  > #end
>  >
>  > 1. Is there documentation on this somewhere? I can't seem to find it
>  > atm.
>  >
>  > 2. How do I setup "jdbc/myconnection". I'm not very familiar with
>  > how that all works. I know it's a java thing, and is probably defined
>  > in an xml file somewhere.
>  >
>  > Thanks,
>  > Christopher Falzone
>  > Edinboro University of PA
>  >
>  >
>
>  --
>  Jason Tesser
>  dotmarketing, Lead Programmer
>  1-305-858-1422
>  



--
Jason Tesser
dotmarketing, Lead Programmer
1-305-858-1422


dotCMS: Opensource CMS goodness.
http://www.dotcms.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/dotcms/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/dotcms/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 
Reply | Threaded
Open this post in threaded view
|

Re: Volcity Database Query

Mr. Christopher Falzone
Well,

Come to find out .. my DBA was incorrect.  Named nstances do not run on
a random port in MSSQL.  They have a set port and you can use that.  For
more info see:  http://support.microsoft.com/kb/313225

Thanks,

Christopher F. Falzone
Technology & Communications
Edinboro University
(814) 732-1080
[hidden email]
http://www.edinboro.edu

Great Things Happen Here!



Jason Tesser wrote:

>
> Well you will need to make sure that the instance is listening on the
> same port. you can set the port after the host with host:port
>
> if you do not set the port the default port is used. But if you are
> going to connect to a db or a service generally you need an ip and a
> port. in this case those ports cannot be random.
>
> On Jan 24, 2008 11:47 AM, Christopher F. Falzone
> <[hidden email] <mailto:cfalzone%40edinboro.edu>> wrote:
> >
> >
> >
> >
> >
> >
> > Thanks Jason,
> >
> > I know we had talked about it before .. just couldn't remember where it
> > was.
> >
> > Also, I started to plug this in, but ran into the same stumbling block I
> > had setting up the MSSQL DB for DotCMS. The problem was that we had
> > installed the dotcms DB into a named instance. The only way we
> finally got
> > around that was putting it onto a default instance.
> >
> > So ... Does anyone know how to define the URL for a named instance that
> > runs on a random range of ports? This particular database is running
> on a
> > machine named "mahagony" on an instance named "tac" and in a db name
> > "webkeywords". My initial thought was:
> >
> > <Resource name="jdbc/WebKeyword" auth="Container"
> > type="javax.sql.DataSource"
> > maxActive="100" maxIdle="30" maxWait="10000"
> > username="dotCMSUser" password="..."
> > driverClassName="net.sourceforge.jtds.jdbc.Driver"
> > url="jdbc:jtds:sqlserver://mahogony/tac/dotcms
> <sqlserver://mahogony/tac/dotcms>"/>
> >
> > Any thoughts?
> >
> > Christopher F. Falzone
> > Technology & Communications
> > Edinboro University
> > (814) 732-1080
> > [hidden email] <mailto:cfalzone%40edinboro.edu>
> > http://www.edinboro.edu <http://www.edinboro.edu>
> >
> > Great Things Happen Here!
> >
> >
> >
> > Jason Tesser wrote:
> >
> >
> >
> > Well you can set up the datasource in the server.xml or in the
> > ROOT.xml if running latest stable and tomcat 6.
> >
> > http://dotcms.org/documentation/tips_tricks.dot#SQLQuery 
> <http://dotcms.org/documentation/tips_tricks.dot#SQLQuery>
> >
> > On Jan 24, 2008 10:34 AM, ctiggerf <[hidden email]
> <mailto:cfalzone%40edinboro.edu>> wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > > I know at some point I've seen the ability to query databases with
> > > velocity. It looked something like:
> > >
> > > #set ($dbConnection = 'jdbc/myconnection')
> > > #getSQLResults('select * from myTable')
> > >
> > > <p>$SQLError</p>
> > >
> > > #foreach($row in $results)
> > > $row.field
> > > #end
> > >
> > > 1. Is there documentation on this somewhere? I can't seem to find it
> > > atm.
> > >
> > > 2. How do I setup "jdbc/myconnection". I'm not very familiar with
> > > how that all works. I know it's a java thing, and is probably defined
> > > in an xml file somewhere.
> > >
> > > Thanks,
> > > Christopher Falzone
> > > Edinboro University of PA
> > >
> > >
> >
> > --
> > Jason Tesser
> > dotmarketing, Lead Programmer
> > 1-305-858-1422
> >
>
> --
> Jason Tesser
> dotmarketing, Lead Programmer
> 1-305-858-1422
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: Volcity Database Query

Jason Tesser-2
Kind of what I was trying to say :-)

On Jan 24, 2008 1:32 PM, Christopher F. Falzone <[hidden email]> wrote:

>
>
>
>
>
>
>  Well,
>
>  Come to find out .. my DBA was incorrect.  Named nstances do not run on a
> random port in MSSQL.  They have a set port and you can use that.  For more
> info see:  http://support.microsoft.com/kb/313225
>
>  Thanks,
>
>
>  Christopher F. Falzone
> Technology & Communications
> Edinboro University
> (814) 732-1080
> [hidden email]
> http://www.edinboro.edu
>
> Great Things Happen Here!
>
>
>
>  Jason Tesser wrote:
>
>
>
>
> Well you will need to make sure that the instance is listening on the
>  same port. you can set the port after the host with host:port
>
>  if you do not set the port the default port is used. But if you are
>  going to connect to a db or a service generally you need an ip and a
>  port. in this case those ports cannot be random.
>
>  On Jan 24, 2008 11:47 AM, Christopher F. Falzone <[hidden email]>
> wrote:
>  >
>  >
>  >
>  >
>  >
>  >
>  > Thanks Jason,
>  >
>  > I know we had talked about it before .. just couldn't remember where it
>  > was.
>  >
>  > Also, I started to plug this in, but ran into the same stumbling block I
>  > had setting up the MSSQL DB for DotCMS. The problem was that we had
>  > installed the dotcms DB into a named instance. The only way we finally
> got
>  > around that was putting it onto a default instance.
>  >
>  > So ... Does anyone know how to define the URL for a named instance that
>  > runs on a random range of ports? This particular database is running on a
>  > machine named "mahagony" on an instance named "tac" and in a db name
>  > "webkeywords". My initial thought was:
>  >
>  > <Resource name="jdbc/WebKeyword" auth="Container"
>  > type="javax.sql.DataSource"
>  > maxActive="100" maxIdle="30" maxWait="10000"
>  > username="dotCMSUser" password="..."
>  > driverClassName="net.sourceforge.jtds.jdbc.Driver"
>  > url="jdbc:jtds:sqlserver://mahogony/tac/dotcms"/>
>  >
>  > Any thoughts?
>  >
>  > Christopher F. Falzone
>  > Technology & Communications
>  > Edinboro University
>  > (814) 732-1080
>  > [hidden email]
>  > http://www.edinboro.edu
>  >
>  > Great Things Happen Here!
>  >
>  >
>  >
>  > Jason Tesser wrote:
>  >
>  >
>  >
>  > Well you can set up the datasource in the server.xml or in the
>  > ROOT.xml if running latest stable and tomcat 6.
>  >
>  > http://dotcms.org/documentation/tips_tricks.dot#SQLQuery
>  >
>  > On Jan 24, 2008 10:34 AM, ctiggerf <[hidden email]> wrote:
>  > >
>  > >
>  > >
>  > >
>  > >
>  > >
>  > > I know at some point I've seen the ability to query databases with
>  > > velocity. It looked something like:
>  > >
>  > > #set ($dbConnection = 'jdbc/myconnection')
>  > > #getSQLResults('select * from myTable')
>  > >
>  > > <p>$SQLError</p>
>  > >
>  > > #foreach($row in $results)
>  > > $row.field
>  > > #end
>  > >
>  > > 1. Is there documentation on this somewhere? I can't seem to find it
>  > > atm.
>  > >
>  > > 2. How do I setup "jdbc/myconnection". I'm not very familiar with
>  > > how that all works. I know it's a java thing, and is probably defined
>  > > in an xml file somewhere.
>  > >
>  > > Thanks,
>  > > Christopher Falzone
>  > > Edinboro University of PA
>  > >
>  > >
>  >
>  > --
>  > Jason Tesser
>  > dotmarketing, Lead Programmer
>  > 1-305-858-1422
>  >
>
>  --
>
>  Jason Tesser
>  dotmarketing, Lead Programmer
>  1-305-858-1422
>  



--
Jason Tesser
dotmarketing, Lead Programmer
1-305-858-1422


dotCMS: Opensource CMS goodness.
http://www.dotcms.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/dotcms/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/dotcms/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 
Reply | Threaded
Open this post in threaded view
|

Re: Volcity Database Query

Mr. Christopher Falzone
In reply to this post by Jason Tesser-2
The second example on
http://dotcms.org/documentation/tips_tricks.dot#SQLQuery 
<http://dotcms.org/documentation/tips_tricks.dot#SQLQuery>

States that you should check $SQLError in the following fashion:

#if($SQLError)
Custom SQL message - I Failed
#else
...
#end

Which, for me, fell into the error message every time. I think it should be:

#if($UtilMethods.isset($SQLError))
Custom SQL message - I Failed
#else
...
#end


Christopher F. Falzone
Technology & Communications
Edinboro University
(814) 732-1080
[hidden email]
http://www.edinboro.edu

Great Things Happen Here!



Jason Tesser wrote:

>
> Well you will need to make sure that the instance is listening on the
> same port. you can set the port after the host with host:port
>
> if you do not set the port the default port is used. But if you are
> going to connect to a db or a service generally you need an ip and a
> port. in this case those ports cannot be random.
>
> On Jan 24, 2008 11:47 AM, Christopher F. Falzone
> <[hidden email] <mailto:cfalzone%40edinboro.edu>> wrote:
> >
> >
> >
> >
> >
> >
> > Thanks Jason,
> >
> > I know we had talked about it before .. just couldn't remember where it
> > was.
> >
> > Also, I started to plug this in, but ran into the same stumbling block I
> > had setting up the MSSQL DB for DotCMS. The problem was that we had
> > installed the dotcms DB into a named instance. The only way we
> finally got
> > around that was putting it onto a default instance.
> >
> > So ... Does anyone know how to define the URL for a named instance that
> > runs on a random range of ports? This particular database is running
> on a
> > machine named "mahagony" on an instance named "tac" and in a db name
> > "webkeywords". My initial thought was:
> >
> > <Resource name="jdbc/WebKeyword" auth="Container"
> > type="javax.sql.DataSource"
> > maxActive="100" maxIdle="30" maxWait="10000"
> > username="dotCMSUser" password="..."
> > driverClassName="net.sourceforge.jtds.jdbc.Driver"
> > url="jdbc:jtds:sqlserver://mahogony/tac/dotcms
> <sqlserver://mahogony/tac/dotcms>"/>
> >
> > Any thoughts?
> >
> > Christopher F. Falzone
> > Technology & Communications
> > Edinboro University
> > (814) 732-1080
> > [hidden email] <mailto:cfalzone%40edinboro.edu>
> > http://www.edinboro.edu <http://www.edinboro.edu>
> >
> > Great Things Happen Here!
> >
> >
> >
> > Jason Tesser wrote:
> >
> >
> >
> > Well you can set up the datasource in the server.xml or in the
> > ROOT.xml if running latest stable and tomcat 6.
> >
> > http://dotcms.org/documentation/tips_tricks.dot#SQLQuery 
> <http://dotcms.org/documentation/tips_tricks.dot#SQLQuery>
> >
> > On Jan 24, 2008 10:34 AM, ctiggerf <[hidden email]
> <mailto:cfalzone%40edinboro.edu>> wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > > I know at some point I've seen the ability to query databases with
> > > velocity. It looked something like:
> > >
> > > #set ($dbConnection = 'jdbc/myconnection')
> > > #getSQLResults('select * from myTable')
> > >
> > > <p>$SQLError</p>
> > >
> > > #foreach($row in $results)
> > > $row.field
> > > #end
> > >
> > > 1. Is there documentation on this somewhere? I can't seem to find it
> > > atm.
> > >
> > > 2. How do I setup "jdbc/myconnection". I'm not very familiar with
> > > how that all works. I know it's a java thing, and is probably defined
> > > in an xml file somewhere.
> > >
> > > Thanks,
> > > Christopher Falzone
> > > Edinboro University of PA
> > >
> > >
> >
> > --
> > Jason Tesser
> > dotmarketing, Lead Programmer
> > 1-305-858-1422
> >
>
> --
> Jason Tesser
> dotmarketing, Lead Programmer
> 1-305-858-1422
>
>