of my previous post to in my beans or external POJOs to share the same dbform-connection without creating new ones... (in this way I should use also the pool-connector).
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Because that's not the way to use tags. If you reaally want to write java code into your jsp the example Ivan wrote was much simplier to use.
The getConnection tag is usefull if you want to use the sql jsp standard tag library.
Henner
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, seems that I'm not really deep into the JSP issue... ;-)
The backround is, to set a lock flag in a record, during a user calls the JSP view of a record. This will help to prevent for double using a record.
Maybe it's a good task to put it in a bean.
Thanks for your hints + regards T.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmm - and how will you unlock the record? Think about your user - he will stay on the record he just visited for the rest of his life (Or up to the end of the session, session timeout). How will you do the unlock in this case?
Henner
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There's an applet for editing server side documents running in our web application. This applet has a communication with our server and while the user press "save and exit" inside the applet, we will check back the document and unlock the record in our db.
regards T.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
is it possible to retrieve the dbforms database connection con on the JSP scripting level?
Thanks + regards T.
Yes you can. Use <getConnection> tag!
Henner
Another way is to implement in a class/bean (also a static class if you need it) a method like this:
public static Connection getDbformsConnection() {
Connection conDbforms;
conDbforms=null;
try {
conDbforms = DbFormsConfigRegistry.instance().lookup().getConnection();
} catch (Exception e) {
System.out.println("Error getting dbforms connection:"
+ e.getMessage());
}
Cheers
That's the way the getConnection tag works!
Cheers
Henner
Yes,
I use the method
"public static Connection getDbformsConnection() "
of my previous post to in my beans or external POJOs to share the same dbform-connection without creating new ones... (in this way I should use also the pool-connector).
Cheers
Thanks for your class/bean snippet above. Now I could use a connection from the dbforms framework in my bean.
regards T.
Hi,
this is what I've tried:
<db:getConnection id="testCon">
<%
int Row = 0;
String lockUserQuery = "foo";
try
{
Statement stmt = testCon.createStatement();
Row = stmt.executeUpdate(lockUserQuery);
stmt.close();
}
catch (SQLException e)
{
e.printStackTrace();
}
%>
</db:getConnection>
Unfortunately there's a compiler failure: cannot resolve symbol
symbol : variable testCon
What's wrong with my code? How do I pass the connection to the script?
Thanks in advance T.
Because that's not the way to use tags. If you reaally want to write java code into your jsp the example Ivan wrote was much simplier to use.
The getConnection tag is usefull if you want to use the sql jsp standard tag library.
Henner
OK, seems that I'm not really deep into the JSP issue... ;-)
The backround is, to set a lock flag in a record, during a user calls the JSP view of a record. This will help to prevent for double using a record.
Maybe it's a good task to put it in a bean.
Thanks for your hints + regards T.
Hmm - and how will you unlock the record? Think about your user - he will stay on the record he just visited for the rest of his life (Or up to the end of the session, session timeout). How will you do the unlock in this case?
Henner
Good question, we had discussed a lot about it.
There's an applet for editing server side documents running in our web application. This applet has a communication with our server and while the user press "save and exit" inside the applet, we will check back the document and unlock the record in our db.
regards T.