Keep me busy

So far so good. Looks like quite a few have come in to help you.

Take it from me, Ducky's a nice guy.

I mistook him for a woman for a day or two when I first met him. Boy was that embarassing!
 
love2teaseu said:
So far so good. Looks like quite a few have come in to help you.

Take it from me, Ducky's a nice guy.

I mistook him for a woman for a day or two when I first met him. Boy was that embarassing!
yeah..some people mistake me for a woman too.
 
kitiara said:
yeah..some people mistake me for a woman too.


Yeah, but you're a HOT guy. A really hot guy. When God made you he stepped back and thought........"Ok, now that's a hot guy."







brrr I got shivers even writing that. Does not compute.
 
DevilishTexan said:
Yeah, but you're a HOT guy. A really hot guy. When God made you he stepped back and thought........"Ok, now that's a hot guy."







brrr I got shivers even writing that. Does not compute.

Speakin of hot guys. Have you checked on ccr?
 
Eeekk..it's been a while..

public void doGet (HttpServletRequest request, HttpServletResponse response)
{
try {
loadOracleJDBCDriver ();
Connection conn = getConnected ();
Statement stmt = makeStatement (conn);

response.setContentType ("text/xml");
ServletOutputStream out = response.getOutputStream();
out.println ("<?xml version=\"1.0\" standalone=\"yes\"?>"); // xml header
out.println ("<?xml-stylesheet type=\"text/xsl\" href=\"/examples/servlets/ProductLista.xsl\"?>"); // xsl ss

out.println ("<ProductList>"); // root element
//single ticks are used with double quotes because you can't have double quotes more than once

// Prepare query based on uploaded user search criteria
String title = request.getParameter ("title");
String author = request.getParameter ("author");
String isbn = request.getParameter ("isbn");
String query = "SELECT Title, Author, ISBN, round(Cost,2), QuantityOnHand FROM Products ORDER by Title" ;
//String query = "SELECT Title, Author, ISBN, Cost, QuantityOnHand FROM Products ";
if ( title != null & ! title.equals ("") )
query = "SELECT Title, Author, ISBN, round(Cost,2), QuantityOnHand FROM Products WHERE Title LIKE '" + title + "' ORDER by Title ";

if (author != null & ! author.equals ("") )
if (query.indexOf ("WHERE") == -1 )
//if author is not null and (==-1 means) there is no previous where,then title is empty, only author has an entry
query = "SELECT Title, Author, ISBN, round(Cost,2), QuantityOnHand FROM Products WHERE Author LIKE '" + author + "' ORDER by Title ";
//if author is not null and (==-1 means) there is no previous where then title is empty, only author
else
query = "SELECT Title, Author, ISBN, round(Cost,2), QuantityOnHand FROM Products WHERE Title LIKE '" + title + "' AND Author LIKE '" + author + "' ORDER by Title ";
//if author is not null and there is a previous where then title AND author have an entry

if (isbn != null & ! isbn.equals ("") )
if (query.indexOf ("WHERE") == -1 )
//if isbn is not null and (==-1 means) there is no previous where, then title,author are empty,only isbn has entry
query = "SELECT Title, Author, ISBN, round(Cost,2), QuantityOnHand FROM Products WHERE ISBN LIKE '" + isbn + "' ORDER by Title ";
else
if (author != null & ! author.equals (""))
if ( title = null & title.equals ("") )
// isbn is not null and author is not null and there is a prior where, title is null
query = "SELECT Title, Author, ISBN, round(Cost,2), QuantityOnHand FROM Products WHERE Author LIKE '" + author + "' AND ISBN LIKE '" + isbn + "' ORDER by Title ";
if (title != null & ! title.equals (""))
// if isbn is not null,author is not null, title is not null and there is a prior where
query = "SELECT Title, Author, ISBN, round(Cost,2), QuantityOnHand FROM Products WHERE Author LIKE '" + author + "' AND ISBN LIKE '" + isbn + "' AND Title LIKE '" + title + "' ORDER by Title ";

else
// if isbn is not null and author is null and there is a prior where:is title
query = "SELECT Title, Author, ISBN, round(Cost,2), QuantityOnHand FROM Products WHERE Title LIKE '" + title + "' AND ISBN LIKE '" + isbn + "' ORDER by Title ";




//query = query + "And ISBN LIKE '" + isbn + "' ";
//"SELECT Title, Author, ISBN, QuantityOnHand From Products"
// "WHERE Title LIKE '" + title + "' "
// and ISBN LIKE '" + isbn + "'




ResultSet rs = openResultSet (stmt, query);
processResultSet (out, rs); // print results as xml
closeThingsDown (rs, stmt, conn); // close db stuff

out.println ("</ProductList>"); // close root
}
catch (IOException e) {
System.err.println (e.getMessage () );
}
}

public void doPost (HttpServletRequest request, HttpServletResponse response) {
doGet (request, response);
}
}
 
DevilishTexan said:
Yeah, but you're a HOT guy. A really hot guy. When God made you he stepped back and thought........"Ok, now that's a hot guy."







brrr I got shivers even writing that. Does not compute.
lolololoooo...

You know it got you hot..
 
linuxgeek said:
I wonder which annoys people more... us posting code or binary.
Yeah..this is from my class project..


// Integrated Case Study: Course 6 v2.0
// Customer.java

// Class to represent the details of a Customer

import java.sql.*;
import java.util.*;

public class Customer {

// Uses the Customer information within the Order to determine whether the Customer
// already exists in the database. If it does, it returns the corresponding CustId. If it
// does not, then it creates the Customer and returns the new CustId.

public int findOrCreateCustomer (BookNookDBConnMgr theDB) {
custId = 0;
String query = "SELECT CustId FROM Customers WHERE " +
" FirstName='" + firstName + "' AND " +
" LastName='" + lastName + "' AND " +
" Address1='" + addr1 + "' AND " +
" Zip ='" + zip + "'" ;
if (addr2 != null && ! addr2.equals ("") )
query += "AND Address2='" + addr2 + "'";

try {
Statement stmt = theDB.getConnection().createStatement ();
ResultSet rs = stmt.executeQuery (query);
if (rs.next() )
custId = rs.getInt (1);
else {
custId = theDB.getNextCustomerId ();

String update = "INSERT INTO Customers " +
" (CustId, FirstName, LastName, CompanyName, Address1, Address2, " +
" City, State, Zip, Phone ) VALUES " +
" (" + custId + ", '" + firstName + "', '" + lastName + "', '" + company + "', '" +
addr1 + "', '" + addr2 + "', '" + city + "', '" + state + "', '" + zip + "', ' ' ) ";

System.out.println (update);
stmt.execute (update);
}
rs.close ();
stmt.close();
}
catch (SQLException e) {
System.err.println (e.getMessage () );
}

insertOrUpdateCreditInfo (theDB);
return custId;
}

public void insertOrUpdateCreditInfo (BookNookDBConnMgr theDB) {
System.out.println ("In insertCreditInfo...");
String update = "INSERT INTO CreditInfo " +
" (CustId, CreditType, CardNumber, ExpDate ) VALUES " +
" (" + custId + ", '" + creditType + "', '" + cardNumber + "', '" + expDate + "' ) ";
try {
Statement stmt = theDB.getConnection().createStatement ();
System.out.println ("\n" + update);
stmt.execute (update);
stmt.close();
}
catch (SQLException e) {
try {
update = "UPDATE CreditInfo SET CreditType='" + creditType + "', " +
"CardNumber='" + cardNumber + "', ExpDate='" + expDate + "' " +
" WHERE CustId=" + custId;
Statement stmt = theDB.getConnection().createStatement ();
System.out.println ("\n" + update);
stmt.execute (update);
stmt.close();
}
catch (SQLException e2) { } // shouldn't happen
}
System.out.println ("Leaving insertCreditInfo...");
}

// Function returns todays date as a String in form: MM/DD/YYYY
private static String todayDateString () {
GregorianCalendar c = new GregorianCalendar ();
return (c.get(Calendar.MONTH) + 1) + "/" +
c.get (Calendar.DAY_OF_MONTH) + "/" +
c.get (Calendar.YEAR) ;
}

public static double getTotalDailyPurchase (String cardNumber, BookNookDBConnMgr theDB) {
double totalDailyPurchase = 0.0;
try {
Statement stmt = theDB.getConnection().createStatement (); // get a statement to use

String query = "SELECT SUM(TotalCost) FROM Orders O, Customers C, CreditInfo CI WHERE " +
"CI.CardNumber='" + cardNumber + "' AND C.CustId=CI.CustId AND C.CustId=O.CustId " +
" AND OrderDate=TO_DATE('" + todayDateString() + "', 'MM/DD/YYYY') ";
System.err.println (query);
ResultSet rs = stmt.executeQuery (query);
if ( rs.next () ) {
System.err.println ("Processing record");
totalDailyPurchase = rs.getDouble (1);
}
rs.close ();
stmt.close();
}
catch (SQLException e) {
System.out.println ("getTotalDailyPurchase: " + e.getMessage());
}
System.err.println ("Total Daily purchase: " + totalDailyPurchase);
return totalDailyPurchase;
}

public int custId;
public String firstName, lastName, company, addr1, addr2, city, state, zip;
public String creditType, cardNumber, expDate;
}
 
DevilishTexan said:
No. Cmdr. Crotch Rocket guy. Now salute in his honor.
is that what he makes you do? "Salute" him?

LOL


I didn't know you were into guys..
 
kitiara said:
is that what he makes you do? "Salute" him?

LOL


I didn't know you were into guys..
You can learn amazing things on the GB.


*nods*
 
linuxgeek said:
I wonder which annoys people more... us posting code or binary.
Lit is educational..

LOL

They don't have to read the thread..
 
Back
Top