Skip to content

Instantly share code, notes, and snippets.

@Mahkul
Mahkul / Book.java
Created April 9, 2011 11:56
Book class
package database;
public class Book
{
/* at the very beginning we need to create instance variables **/
public String title;
public String author;
java.sql.SQLException: Invalid handle
java.sql.SQLException: Invalid handle
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(Unknown Source)
at database.BookDatabase.getBookStoreTotalCost(BookDatabase.java:130)
at database.BookGUI.actionPerformed(BookGUI.java:175)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
package database;
import java.sql.*;
public class BookDatabase {
private String user = "";
private String password = "";
static String url = "jdbc:odbc:Books";
package database;
import java.awt.FlowLayout;
import java.awt.Container;
import java.awt.event.ActionEvent;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.sql.SQLException;
/**
@Mahkul
Mahkul / BookGUI.java
Created April 9, 2011 14:34
Pawel's BookGUI
package pawel.bookshelf;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/**
* This class creates the GUI for the BooShelf. There are methods for creating main frame,
* top menu, add book dialog box, saving book data to the bookshelf.
*
package pawel.bookshelf;
import java.sql.*;
public class BookShelf {
private String user = "";
private String password = "";
static String url = "jdbc:odbc:Books";