This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pawel.bookshelf; | |
import java.sql.*; | |
public class BookShelf { | |
private String user = ""; | |
private String password = ""; | |
static String url = "jdbc:odbc:Books"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package database; | |
import java.sql.*; | |
public class BookDatabase { | |
private String user = ""; | |
private String password = ""; | |
static String url = "jdbc:odbc:Books"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package database; | |
public class Book | |
{ | |
/* at the very beginning we need to create instance variables **/ | |
public String title; | |
public String author; | |