Skip to content

Instantly share code, notes, and snippets.

View ixcuincle's full-sized avatar

Spencer ixcuincle

View GitHub Profile
import java.util.Scanner;
public class C5Sum {
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
//Getting the number
import java.util.Scanner;
public class C5Main {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
//System.out.print("Enter a number: ");
//int n= input.nextInt();
for(int n = 1; n<=100; n++)
private void CheckOut() {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection library = DriverManager.getConnection([VALID CONNECTION HERE]);
Statement stmt = library.createStatement();
PreparedStatement preparedStmt=library.prepareStatement ("Update Book set bookcopies = bookcopies - 1 where booktitle="+jtfBookCheckedOut.getText());
preparedStmt.executeUpdate();
String sqlCommands = "UPDATE Patron, Book "
+ "SET firstname = '"+ firstname +"', lastname = '"+ lastname +"', "
+ "bookcheckedout = '"+bookcheckedout+"', book.bookcopies = book.bookcopies - 1 "
+ "WHERE patronid = '"+ pid + "';";
@ixcuincle
ixcuincle / gist:5490163
Created April 30, 2013 17:05
SET isn't recognized.
private void UpdateSQL() {
String sid = jtfStaffId.getText();
String firstname = jtfFirstName.getText();
String lastname = jtfLastName.getText();
String midinit = jtfMidInit.getText();
String address = jtfAddress.getText();
String city = jtfCity.getText();
String state = jtfState.getText();
String phone = jtfPhoneNum.getText();
@ixcuincle
ixcuincle / gist:5490139
Created April 30, 2013 17:03
The SQL statement works fine in SQL but not in Java.
/** View SQL commands */
private void ViewSQL() {
String sid = jtfStaffId.getText();
if (connection == null) {
jtaSQLResult.setText("Please connect to a database first");
return;
}
else {
@ixcuincle
ixcuincle / UTTwitter
Last active December 15, 2015 11:59
UT Twitters
[URL="https://twitter.com/petergoodwin92"]Shrimper[/URL]
[URL="http://www.twitter.com/2noided"]Forest Whitaker[/URL]
[URL="http://www.twitter.com/cedwardslino"]Imaginary Threats[/URL]
[URL="http://www.twitter.com/londonhockey71"]jumptheshark[/URL]
[URL="http://www.twitter.com/SwedishPuma"]Swedish Puck Mafia[/URL]
[URL="http://www.twitter.com/AnthonyRescan"]Murray's Twitter[/URL]
[URL="http://www.twitter.com/aheavenlyforest"]Trance Kuja[/URL]
[URL="http://www.twitter.com/deficientmode"]Deficient Mode[/URL]
[URL="http://www.twitter.com/ceremonyhf"]Ceremony[/URL]
[URL="http://www.twitter.com/FyC_HR"]FyC[/URL]