Anyway to create my own customized message after a insert or update in a Oracle 9i table?
Here is my trigger attempt:
DECLARE
city varchar2(100);
Begin
if city is null then
RAISE_APPLICATION_ERROR(-20000,'NO DATA ENTERED');
end if;
end;
This trigger did output a message on a blank insert...
Does Cold Fusion support PreparedStatements?
I use them in Java and was wondering if Cold Fusion also has them for SQL inserts and updates into Oracle and Access databases?
Thanks for the information from both of you!
The program will only insert one city at a time.
I assumed I was closing the connection from cityInserter method which is why I have a closed statement in the dbMethod. If I close directly in the cityInserter method the insert doesnt work.
Also I...
Thanks, I did some research and found it is not a good idea to put a Database connection in a Constructor.
I changed it where I combined the classes:
public class DbWork
{
private Connection connection = new ConnectionMgr().getConnection();
private PreparedStatement stat...
I have a JDBC working with Oracle 9i in my Tomcat 4.1.3 Container.
The Database classes I have used for the past year are working great but I wonder if I should be closing anything in my database helper class with Prepared statements:
public class DbInsert
{
private PreparedStatement stat...
Also, by the way that link you gave me is an excellent place to start because I used it (with some modifications) for my form validations because I cant get Struts at this time.
Thanks,
I ended up using an Array in the action page and listing the info from it. I was going to use Enumeration but it didnt guarantee order like I needed.
I have a Form with 10 fields on it and I need to send an email with all 10 field values. The email output will look like this:
First Name: Joe
Last Name: Smith
City: Dallas
State: Texas
....
The form will pass the values to a Servlet which will call a JavaBean class that will get the values...
I have 2 methods working in my class file that I am trying to convert into 1 method:
.....
public Preparestatement prep;
public int inserterOne(TheBean mybean)
{
int status = 0;
try {
prep.connection.preparestatement("insert into person (city, state) values (?,?)")...
I have the same results with SQL statement in my Database class file several times and was wondering if I can make it into a method?
public somemethod()
{
ResultSet results = null;
Statement statement = null;
...
//next two lines are repeated several times in different methods in this class...
Thanks, it seems to be okay but in my Tomcat Startup Dos window it keeps printing out my Catch Resultset output saying "closing resultset error" so I eliminated all the close the resultsets and that eliminated the "closing resultset error". I kept the statement and connection close statements...
Is it okay to create 3 different ResultSets with the same Statement object? Here is what I am currently using in my Database statements with Oracle and everything works great. But I am wondering if this will create Database resource leakages or other issues:
//Db connection called from...
How can I combine the two below queries in Access 2003 where I need to know if none, one or both of the queries got a hit from form entries taken from a Web page:
select * from mytable
where firstname = 'formvariable.pocfirstname'
and lastname = 'formvariable.poclastname';
select * from...
I am trying to make sure I know what exactly is meant by the Model part of MVC design pattern.
Model is where you have the Business rules. For example if I had a Form in the Presentation part (JSP) that had a Field entry called Street and I only wanted the user to be able to enter one of three...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.