Brian,

You need to add a commit statement at the end.

-----Original Message-----
From: Tony Reres [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 15, 2000 10:49 AM
To: JRun-Talk
Subject: Re: "Lying Code"


Brian,
Try using stmt.executeQuery( ) or stmt.execute???().
The executeUpdate() will return a bogus code cause its really meant for SQL
'UPDATE' statements.

Tony
PS How do you like the JTURBO product, Would you recommend it?

----- Original Message -----
From: "Piotrowski, Brian" <[EMAIL PROTECTED]>
To: "JRun-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, November 14, 2000 3:43 PM
Subject: "Lying Code"


> Well, I think I fixed my JDBC problem.  Now when I click on TEST, I get
the
> response "The following error has been recevied: NULL".  That means that
the
> JDBC driver is correctly installed, right?
>
> Now, I have a new problem.  When I get the system to create a table, it
goes
> through the code, and then comes back indicating that the table was
created.
> However, when I look at the table list on the database, its not there.
Can
> someone look at this code and tell me if I'm doing something wrong??
>
> <%@ page info="database handler"%>
> <%@ page import="java.io.*"%>
> <%@ page import="java.util.*"%>
> <%@ page import="java.sql.*"%>
> <%@ page import="javax.servlet.*"%>
> <%@ page import="javax.servlet.http.*"%>
> <%
> try
> {
> Class.forName("com.ashna.jturbo.driver.Driver");
> String url="jdbc:JTurbo:dupontdb";
> Connection con=DriverManager.getConnection(url);
> Statement stmt = con.createStatement();
> String query="CREATE TABLE COFFEES" +
> "(COF_NAME VARCHAR(32),"+
> "SUP_ID INTEGER,"+
> "PRICE FLOAT,"+
> "SALES INTEGER,"+
> "TOTAL INTEGER)";
> stmt.executeUpdate(query);
> }
> catch (Exception e) {}
> out.println("table coffees created");
> %>
>
> Thanks in advance.
>
> Brian.
>
> -----------------------------------
> Brian Piotrowski
> Developer / Network Administrator
> Moneyramp.com
> (705) 475-9531
> www.moneyramp.com
> -----------------------------------
> --------------------------------------------------------------------------
----
> Archives: http://www.egroups.com/group/jrun-interest/
> Unsubscribe:
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
> or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.
>
----------------------------------------------------------------------------
--
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe:
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe'
in the body.
------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the 
body.

Reply via email to