JDBC locking access db

i can create the table from jframe. i can open the program and instantly insert records, but if i insert a table, then try and insert records i get sqlexception error saying database is locked by othe process and I DON'T have Access open or another instance of this program. but it does seem to write the new records. any help would be great. fully runnable code presuming you setup Coffee DSN. it locks on line 180 which is part of the tableExistsCreateNew method where i try and drop the table.
mike
screen output.
A Table already exists with data
Old table was deleted.
New table was created successfully
Table has data records, they will be deleted
An empty table exists
Error in creatingtable after dropping.Records were created successfully
import java.io.*;
import java.net.*;
import java.sql.*;
import javax.swing.JTextPane;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
* CoffeeDBAdmin.java
* Created on July 20, 2004, 1:33 PM
* @author Participant5
public class CoffeeDBAdmin extends javax.swing.JFrame {
/** Creates new form CoffeeDBAdmin */
Connection conn;
String message;
public CoffeeDBAdmin() {
initComponents();
createConnection();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
private void initComponents() {//GEN-BEGIN:initComponents
jTextPane1 = new javax.swing.JTextPane();
jMenuBar1 = new javax.swing.JMenuBar();
MenuDatabase = new javax.swing.JMenu();
CreateTable = new javax.swing.JMenuItem();
Insert = new javax.swing.JMenuItem();
Retrieve = new javax.swing.JMenuItem();
Exit = new javax.swing.JMenuItem();
setTitle("CoffeeDBAdmin");
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
jTextPane1.setMinimumSize(new java.awt.Dimension(375, 200));
jTextPane1.setPreferredSize(new java.awt.Dimension(375, 200));
getContentPane().add(jTextPane1, java.awt.BorderLayout.CENTER);
MenuDatabase.setText("Database");
MenuDatabase.setActionCommand("MenuDatabase");
CreateTable.setText("Create Table");
CreateTable.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseReleased(java.awt.event.MouseEvent evt) {
CreateTableMouseReleased(evt);
MenuDatabase.add(CreateTable);
Insert.setText("Insert");
Insert.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseReleased(java.awt.event.MouseEvent evt) {
InsertMouseReleased(evt);
MenuDatabase.add(Insert);
Retrieve.setText("Retrieve");
Retrieve.setActionCommand("Retrieve");
Retrieve.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseReleased(java.awt.event.MouseEvent evt) {
RetrieveMouseReleased(evt);
MenuDatabase.add(Retrieve);
Exit.setText("Exit");
Exit.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseReleased(java.awt.event.MouseEvent evt) {
ExitMouseReleased(evt);
MenuDatabase.add(Exit);
jMenuBar1.add(MenuDatabase);
setJMenuBar(jMenuBar1);
pack();
}//GEN-END:initComponents
private void ExitMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ExitMouseReleased
// TODO add your handling code here:
exitRoutine();
}//GEN-LAST:event_ExitMouseReleased
public void createConnection()
try{
//load JDBC ODBC driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//setup the connection
String url = "jdbc:odbc:Coffee";
conn = DriverManager.getConnection
(url, "myLogin", "myPassword");
catch (Exception e)
message = "DSN Error.";
JOptionPane.showInternalMessageDialog(jMenuBar1,
message);
//e.printStackTrace();
public void createTable()
try
Statement stmt = conn.createStatement();
//jTextPane1.setText(null);
//stmt.executeUpdate("DROP TABLE COFFEES");
stmt.executeUpdate("CREATE TABLE COFFEES " +
"(COFFEE_NAME VARCHAR(32), SUP_ID INTEGER, PRICE FLOAT, " +
"SALES INTEGER, TOTAL INTEGER)");
System.out.println();
//jTextPane1.setText(null);
stmt.close();
catch(NullPointerException npe)
//we are gonna leave this empty because if you try and call an update
//without having a database, this exception will occur. it is not
//necessary to throw this exception as the program print a message and
//will exit if there is a database problem.
message = "Database Error";
JOptionPane.showInternalMessageDialog(jMenuBar1,
message);
catch (SQLException tableExists)
//System.out.println("Table already exists");
this.tableExistsCreateNew();
public void tableExistsCreateNew()
try{
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT Coffee_Name, " +
"Price FROM COFFEES");
if((rs.next() == true))
message = "A Table already exists with data\n";
else
message = "An empty table exists\n";
rs = stmt.executeQuery("SELECT Coffee_Name, Price " +
"FROM COFFEES");
jTextPane1.setText(jTextPane1.getText() + "\n" + message);
stmt.executeUpdate("DROP TABLE COFFEES");
jTextPane1.setText(jTextPane1.getText() +
"Old table was deleted.\n");
stmt.executeUpdate("CREATE TABLE COFFEES " +
"(COFFEE_NAME VARCHAR(32), SUP_ID INTEGER, PRICE FLOAT, " +
"SALES INTEGER, TOTAL INTEGER)");
jTextPane1.setText(jTextPane1.getText() +
"New table was created successfully\n");
//this.createRecords();
stmt.close();
//rs.close();
catch(NullPointerException npe)
//we are gonna leave this empty because if you try and call an update
//without having a database, this exception will occur. it is not
//necessary to throw this exception as the program print a message and
//will exit if there is a database problem.
jTextPane1.setText(jTextPane1.getText() + "\nDatabase Error.");
JOptionPane.showInternalMessageDialog(jMenuBar1,"Database" +
" Error");
catch(Exception e)
System.out.println("\nerror in creating table after dropping\n");
e.printStackTrace();
//System.exit(0);
jTextPane1.setText(jTextPane1.getText() + "\nError in creating" +
"table after dropping.\n");
JOptionPane.showInternalMessageDialog(jMenuBar1,
"Error in creating table after dropping.\n");
public void createRecords()
try
{ Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT " +
"Coffee_Name, Price " + "FROM COFFEES");
if(rs.next() == false)
jTextPane1.setText(jTextPane1.getText() +
"\nTable has data records, they will be " +
" deleted\n\n");
//stmt.executeUpdate("DROP TABLE COFFEES");
tableExistsCreateNew();
stmt.executeUpdate("INSERT INTO COFFEES " +
"(Coffee_Name, SUP_ID, Price) " +
"VALUES ('Colombian', 101, 7.99)");
stmt.executeUpdate("INSERT INTO COFFEES "+
"(Coffee_Name, SUP_ID, Price) " +
"VALUES ('French_Roast', 49, 8.99)");
jTextPane1.setText(jTextPane1.getText() + "Records" +
" were created successfully\n");
//rs.close();
stmt.close();
catch (Exception e)
//System.out.println("Error in creating records");
//e.printStackTrace();
//System.exit(0);
message = "The Table you requested does not exist.";
JOptionPane.showInternalMessageDialog(jMenuBar1,message);
public void printRecords()
try
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT Coffee_Name, Price " +
"FROM COFFEES");
jTextPane1.setText("Coffee Prices\n");
//System.out.println("Coffee Prices");
while(rs.next())
jTextPane1.setText((jTextPane1.getText() + rs.getString(1)
+ " " + rs.getDouble(2) + "\n" ));
// System.out.println(rs.getString(1) + " " +
// rs.getDouble(2) + "\n" );
//rs.close();
stmt.close();
//conn.close();
catch(NullPointerException npe)
//we are gonna leave this empty because if you try and call an update
//without having a database, this exception will occur. it is not
//necessary to throw this exception as the program print a message and
//will exit if there is a database problem.
message = "Database Error";
jTextPane1.setText(jTextPane1.getText() + "\n" +
message);
JOptionPane.showInternalMessageDialog(jMenuBar1,"You " +
"cannot retrieve" + "records from a null or " +
"uncreated table");
//System.exit(0);
catch (Exception e)
//message = "Error in printing records";
jTextPane1.setText(jTextPane1.getText() +"\n" +
message);
//System.exit(0);
e.printStackTrace();
//JOptionPane.showInternalMessageDialog(jMenuBar1,"You cannot retrieve" +
//"records from a null or uncreated table");
public void exitRoutine()
try{
conn.close();
dispose();
System.exit(0);
catch (Exception e)
message = "error closing connection";
JOptionPane.showInternalMessageDialog(jMenuBar1,
message);
//e.printStackTrace();
private void RetrieveMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_RetrieveMouseReleased
// TODO add your handling code here:
printRecords();
}//GEN-LAST:event_RetrieveMouseReleased
private void InsertMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_InsertMouseReleased
// TODO add your handling code here:
createRecords();
}//GEN-LAST:event_InsertMouseReleased
private void CreateTableMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CreateTableMouseReleased
// TODO add your handling code here:
createTable();
}//GEN-LAST:event_CreateTableMouseReleased
/** Exit the Application */
private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
dispose();
System.exit(0);
}//GEN-LAST:event_exitForm
* @param args the command line arguments
public static void main(String args[]) {
new CoffeeDBAdmin().show();
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenuItem CreateTable;
private javax.swing.JMenuItem Exit;
private javax.swing.JMenuItem Insert;
private javax.swing.JMenu MenuDatabase;
private javax.swing.JMenuItem Retrieve;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JTextPane jTextPane1;
// End of variables declaration//GEN-END:variables

Are you releasing your connections appropriately?

Similar Messages

  • Locking access to serial ports

    I have two instruments on serial ports, and two independant VIs to control them. One VI may be running, or both, at any one time. The VIs may be running under LabView, or executables.
    I would like some simple and elegant way of ensuring that when I run the second VI, it cannot access whichever port is being used by the first VI. I have experimented with using the VISA Lock Async.vi, which should do exactly that. However, it seems to be possible to have two VIs lock access to the same port, without generating an error. I can only assume that the "lock" is for the application (LabView), not the VIs.
    I have looked at the synchronisation functions for a solution, but I can't see any reasonable way of using them. Semaphores are ok if you want to control access to a single port, but not the undefined list of ports that may be available on any given machine.
    I could use a global array variable containing a list of ports in use. Not very elegant though...

    CDancer a écrit:
    Thanks, guys, but I don't think you have understood my problem. Read the first sentence - 2 completely independant VIs, and 2 or more ports...
    I have written a program today using the globals option, which works very well. There should be a better way though.
    Chris
    ViLabWorks a écrit:
    It isn't exactly clear to me why this is about one port. How much does one serial port cost versus programming time? Or even if it is about 4 serial ports the same applies. For me there is no question, doing something perhaps difficult versus spending next to nothing to solve the problem.
    Well...
    Sometimes you need to access the same equipement from different places in your application, or from different applications...
    Usually I simply set/read a global "busy" boolean.
    One problem I would like to adress is the automatic detection of specific serial hardware. How is it possible to find the port on which some equipment has been connected ? Of course, a solution would be to try to connect to this equipment by sending a command and waiting for the proper answer. However, before doing that, you need to detect the available ports (VISA Find Ressource), then scan each port after setting the proper baud rate, byte length, parity, etc..., then close the port to make it available to another application. Unfortunately, within LabVIEW, this procedure may interfere with other vis already connected to other serial equipments, with impredictable results.
    Apart the solution proposed in my first post, I don't know a way of deciding if a port is already in use. May be I missed something ?
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • In my iPad 3 iOS 6 the icons do not vibrate . How I can remove apps. And the ( lock access code ) not exist in setting / general

    In my iPad 3 iOS 6 the icons do not vibrate . How I can remove apps. And the ( lock access code ) not exist in setting / general

    Did you set any restriction?
    Settings>General>Restriction

  • Locking access to methods...

    Hello everyone,
    I hope somebody can help me with this tricky question. Basically, I need to lock access to other threads while the invoking method thread is executing.
    Given the code below:
    public synchronized string doWork() {
       doSomeWork();
       doMoreWork();
    }Will the methods doSomeWork() and doMoreWork() also be locked to other threads, and if not how can I lock them until doWork() finishes?
    Thank you,
    Sergio Bastos

    That is, both methods will be locked as long as
    doWork is executing.No they won't, will they? Another thread can still
    call doMoreWork. It just can't call it via the main
    function.You can e.g. read on this link:
    http://java.sun.com/docs/books/tutorial/essential/threads/monitors.html
    "A critical section can be a block or a method and is identified with the synchronized keyword. The Java platform associates a lock with every object and the lock is acquired when a critical section is entered."
    doWork has the object lock when it is executing, and no one else will be able to acquire that lock as long as the method is executing.
    Kaj

  • Locking access to email

    Can I lock access to my email program, "Mail" and leave open the rest of my computer.  This is to prevent anyone without a password to view my mail.

    Not really a good way to do this.  It would be better to set up a guest account and let others use that.  Then you could "fast user switch" to the guest account for them leaving your account logged on in the background.

  • Use JDBC to Access XML Documents in Oracle XML DB

    Hi folks,
    From the Oracle XML DB Developer's Guide 10g Release 1 (10.1) Chapter 12 Java API for XMLType, it show several examples for how java application use JDBC to access xml in XMLDB:
    1. use getOPAQUE() on XMLTYPE table/column and then call XMLTYPE.createXML();
    2. use getCLOBVal()/getStringVal()/getBLOBVal() in SQL statement;
    3.use getObject on the result and cast directly to XMLType;
    Among these 3 options, which is supposed to be the fastest way? Any difference between thin and oci?
    I have run some tests about that and the result is the second option (with thin driver) is the fastest. It surprises me because I think oci should be faster than thin. Does the result make sense?
    Thanks.

    Have you tried to trace your sessions to see how much work is happening? Traces should give you quantifiable information on exact times and access paths to the data.
    Below is a link to an O'Reilly book excerpt on Java programming with JDBC. Slightly data, but may be of assistance.
    http://www.onjava.com/lpt/a//onjava/excerpt/oraclejdbc_19/index.html

  • Toplink JPA: jdbc connection access required

    I have a strong reason why direct access to the connections used by Toplink JPA is required: for each connection I need to execute
    - a "set role" to grant permissions,
    - "set lock mode" to prevent hangups,
    - "set isolation" to get the correct transaction type,
    - possibly a "set explain on" to get query costs info,
    - and a "set constraints all deferred" to have constraints checked at commit time, not earlier.
    Can the Toplink pooling mechanism be replaced?

    You can use either an external data source from your container or an JDBC data source for that matter but you cannot replace the internal connection pool. Although one option may be to use a wrapped connection pool of your own I would first recommend looking at the SessionEventListener callbacks. Implementing this interface and registering it using a SessionCustomizer (persistence unit property) would allow you to be notified and get access to the JDBC connection when acquired and released from either pooling mechanism.
    Here is an example:
    public class JDBCConnectionListener extends SessionEventAdapter implements SessionCustomizer {
         * This method is used when this class is configured as the session customizer
         * in the persistence unit properties.
        public void customize(Session session) {
            session.getEventManager().addListener(this);
         * This event is raised after a connection is acquired from a connection pool.
        public void postAcquireConnection(SessionEvent event) {
            DatabaseAccessor da = (DatabaseAccessor)event.getResult();
            Connection con = da.getConnection();
            PreparedStatement statement;
            try {
                event.getSession().log(SessionLog.FINE, SessionLog.SQL, "POST-ACQUIRE> SELECT SYSDATE FROM DUAL");
                statement = con.prepareStatement("SELECT SYSDATE FROM DUAL");
                ResultSet rs = statement.executeQuery();
                rs.close();
            } catch (SQLException e) {
                // TODO
         * This event is raised before a connection is released into a connection pool.
        public void preReleaseConnection(SessionEvent event) {
    }Doug

  • JDBC Lock Table

    I am developing two java programs that are accessing an Oracle database using JDBC. The two programs are to access to same table simultaneously.
    Is there a way I can use an sql LOCK TABLE command to lock a table while one program is writing to the table, and have the other program check for this Lock, and only proceed with updates on that table if the table is not locked? Would I need to have seperate database login IDs to accomplish this?
    For example:
    Program 1
    stmt.executeUpdate("LOCK TABLE A");
    //insert some records
    con.commit();
    Program 2
    While ( TABLE A IS LOCKED)
    //wait
    Update table A

    In future JDBC questions should be posted into the JDBC forum.
    Whatever you are doing don't. Just use transactions. Figure out what kinds of transaction serialization your setup supports too.

  • JDBC MS Access--- cannot extract entry with null value with data type Meta

    I'm trying to extract a data entry with null value by using JDBC. The database is MS Access.
    The question is how to extract null entry with data type memo? The following code works when the label has data type Text, but it throws sqlException when the data type is memo.
    Any advice will be appreciated! thanks!
    Following are the table description and JDBC code:
    test table has the following attributes:
    Field name Data Type
    name Text
    label Memo
    table contents:
    name label
    me null
    you gates
    Code:
    String query = "SELECT name, label FROM test where name like 'me' ";
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next())
    String name = rs.getString("name");
    rs.getString("val");
    String label = rs.getString("label");
    System.out.println("\t"+name+"\t"+label);
    catch (SQLException ex)
    System.out.println(ex.getSQLState());
    System.out.println(ex.getErrorCode());
    System.out.println("in sqlexception");
    output:
    C:\Temp\SEFormExtractor>java DBTest
    yet SELECT name, label FROM test
    null
    0
    in sqlexception

    The question is how to extract null entry with data type memo?Okay, what you need to do is this:
    if (rs.getString("val") == null)
      // do something
    }This way, when it's a null value, you can check it first, and then handle it how you want, rather than getting an exception.

  • How can I lock access to Firefox so that only I can fo on the internet and not other users of my computer?

    I have a computer which I let several other people use, but I don't want them to have access to the internet. I would like to see if there is a "lock" choice so that no one else can access the internet - or another means? I've tried to select "Lock" to the whole computer (when it gives you the "lock," "shut down," "sleep," etc. choices - and it says the computer is locked but the next time I try it it opens the computer (and internet) just like it never was "locked" so I don't even know how to effectively lock the whole computer either as a second option to block access ot the internet!

    I had the same problem (issue with Google Apps and XUL runner etc) of needing to downgrade. To pull it off I went to the main Firefox download page (http://www.mozilla.com/en-US/firefox/new/) and followed the link to OTHER SYSTEMS AND LANGUAGES which took me to a page that included a link on the right hand side to download Firefox 3.6.16.
    (The stuff below pertains to Windows. If you are on a different OS your steps will vary)
    To do the actual downgrade (and there may be some other steps that would be wise to take but this is what worked for me) I merely renamed "c:\Program Files\Mozilla Firefox" to "c:\Program Files\Mozilla Firefox bad" (in case I want to try troubleshooting the issue later) and then ran the "Firefox Setup 3.6.16.exe" file that downloaded from that link. That solved my problem and I'm back and running 3.6.16.
    In case you don't feel comfortable changing things in your Program Files directory you might try a different approach and try uninstalling via the Control Panel and Add and Remove Programs (or whatever it is called on the version of Windows you are on) and then running the installation file. I didn't go that route so I can't tell you how well that might work.

  • Regarding File to JDBC/MS Access database

    Hi all,
    I am trying to insert some values in to MS access database table.I kept the .mdb file in the local PI folder.I am getting connection error
    com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: DriverManagerException: Cannot establish connection to URL 'jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=//test/data/input/Employee.mbd': SAPClassNotFoundException: jdbc.odbc.JdbcOdbcDriver
    i have given the configuration as:
    JDBC Driver:   jdbc.odbc.JdbcOdbcDriver
    Connection:  jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=//test/data/input/Employee.mbd
    Please give me some pointers.
    Regards,
    Anika

    Hi Anika,
    Also please check for :
    You can set the configuration as following:-
    JDBC Driver : sun.jdbc.odbc.JdbcOdbcDriver
    Connection : jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ= Full Path of DB file;
    eg of full path:D:\USERS\Employee\employee.mdb
    Please go through these steps: (Assuming you are working on Windows)
    1) An ODBC driver for your database must be installed on the Windows computer running the application server.
    Check if there's an ODBC driver for MS Acess on the application Server.
    2) To connect through an ODBC driver, you must install the Sun JDBC-ODBC Bridge driver on the Windows computer running the application server. The driver comes with the Sun Java 2 SDK, Standard Edition, for Windows.
    Also there is another point.
    sun.jdbc.odbc.JdbcOdbcDriver
    This driver is a part of the JDK kit and so, you need not install the driver on your XI server. Check the SAP Note JDBC FAQ for this info.
    3)Define a DSN on the Windows system hosting your application server.
    4)These parameters you need to give while configuring the JDBC receiver adapter channel
    Regards
    joel
    Edited by: joel trinidade on Mar 26, 2009 12:45 PM

  • JDBC, Oracle: access denied

    I can load Oracle driver
    Class.forName("oracle.jdbc.driver.OracleDriver");
    But in this string:
    String url = "jdbc:oracle:thin:@195.52.61.6:1521:ORCL";
    java.sql.Connection con = java.sql.DriverManager.getConnection(url, "SCOTT", "TIGER");
    happens exception:
    java.security.AccessControlException: access denied (java.net.SocketPermission 195.52.61.6:1521 connect,resolve)
    I have found in this forum many same messages. Can anybody explain problem?

    Are you using an applet?

  • JSP using jdbc to access mdb

    Done ...
    User DSN and System DSN Add. Select Microsoft Access Driver (*.mbd) and data source name is aa
    in JSP ..
    <%@ page import="com.thinweb.sql.*" %>
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection c1 = DriverManager.getConnection("jdbc : odbc : aa","",""); [no spacing]
    Error: 500
    Location: /gone.jsp
    Internal Servlet Error:
    javax.servlet.ServletException: No suitable driver
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
    at _0002fLoginM_0002ejspLoginM_jsp_10._jspService(_0002fLoginM_0002ejspLoginM_jsp_10.java:181)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
    at java.lang.Thread.run(Thread.java:484)
    Root cause:
    com.thinweb.sql.SQLException: No suitable driver
    at com.thinweb.sql.DriverManager.getConnection(Unknown Source)
    at com.thinweb.sql.DriverManager.getConnection(Unknown Source)
    at _0002fLoginM_0002ejspLoginM_jsp_10._jspService(_0002fLoginM_0002ejspLoginM_jsp_10.java:123)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
    at java.lang.Thread.run(Thread.java:484)

    You must have the JdbcOdbcDriver.class in your classpath.

  • Uninstalling Aperture 3 Trial, iPhoto lock & Access to photos

    Greetings,
    My Aperture trial expired, but I'm not ready to buy.
    The trial open dialog keeps appearing whenever I plug in my iPhone, and now since Aperture expired, iTunes is saying iTunes Library is locked or I don't have permission, so I can't sync my iPhone, in fact I can't even open iTunes. Perhaps unrelated to Aperture, but this lock out happened after I say "quit" to Aperture and I can't bypass Aperture because the iPhone triggers it.
    Now, I'd like to remove the trial of Aperture so I can sync my iPhone, but now I'm reading that all my photos pulled using Aperture are not accessible unless I export the originals. Really? That' seems a bit over reaching, but maybe I'm missing something here. I've shot about 3K photos during the trial and I'd be a bit miffed if Aperture truly prevented me from accessing my own content.
    Some help please.
    Thanks,
    Joan

    Thanks for this info. Moving Aperture to the Trash (and restarting my computer) worked to get my iPhone sync'd.
    Regarding moving master photos, I got a dialog from Aperture when I plugged in my iPhone. It said my trial had ended and if I wanted to export my photos (or similar message). Of course I said yes and moved the photos elsewhere.
    I tried your method after the fact and no masters were in the folder you mentioned, but I'm pretty sure they went into the new export folder I created, which appears to have all the images processed during the test. Just mentioning it appears that process moved files out of the Aperture Library, and not copied them to the new location, but I'm sure you know that. I mention for other readers who may run into a similar problem.
    I did know the trial was ending, I just didn't think (and rightly so) that my images would not be accessible after the trial expired. I am certainly happy for that.
    Thanks for you help.
    Joan

  • JDBC & MS Access

    The following code is from "Java 2 for Dummies":
    import java.sql.*;
    public class CreateTable
    public static void main(String args [])
    throws SQLException, ClassNotFoundException
    Connection connection;
         Statement statement;
         Class.forName
    ("sun.jdbc.odbc.JdbcOdbcDriver");
         connection = DriverManager.getConnection
    ("jdbc:odbc:AccountDatabase");
         statement = connection.createStatement();
         statement.executeUpdate(
         "create table ACCOUNTS " +
         " (NAME VARCHAR(32) NOT NULL PRIMARY KEY, " +
         " ADDRESS VARCHAR(32), " +
    " BALANCE FLOAT) ");
         statement.executeUpdate
         "insert into ACCOUNTS values " +
         "('Barry Burd','222 Cyberspace Lane', 24.02) "
         statement.executeUpdate
         "insert into ACCOUNTS values " +
    "('Jane Public','111 Consumer Street',55.63)"
    statement.close();
    connection.close();
    The code compiles with no errors but I get the following message when executing the code:
    C:\testbed>java CreateTable
    Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC Microsoft Acc
    ess 97 Driver] Syntax error in CREATE TABLE statement.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    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.executeUpdate(Unknown Source)
    at CreateTable.main(CreateTable.java:18)
    =============================================
    I use the following steps to create the data source:
    1. In Win 98 I choose Start....Settings....Control Panel
    2. Double-click Data Sources (ODBC).
    3. In the ODBC Data Source Administrator, select DSN tab
    4. Then Add
    5. In Create New Data Source, select Microsoft Access Driver
    6. Click Finish.
    7. Type AccountDatabase in Data Source Name field.
    8. Type anything in Description field.
    9. Click the Create button.
    10. Browse directory where I want your database file to be created and
    type AccountFile the Database Name field.
    11. Click OK.
    Any clues, why I get the error message?
    Thanks,
    George

    Thanks,
    Based on what you told me, I did some
    research into Access 97 and
    its implementation of the
    SQL "CREATE TABLE" statement.
    I substituted
    "create table ACCOUNTS
    (NAME VARCHAR(32) NOT NULL CONSTRAINT
    MyFieldConstraint PRIMARY KEY,
    ADDRESS VARCHAR(32), BALANCE FLOAT)"
    for
    "create table ACCOUNTS
    (NAME VARCHAR(32) NOT NULL PRIMARY KEY,
    ADDRESS VARCHAR(32), BALANCE FLOAT)"
    Now it works. It seems I needed to include
    the CONSTRAINT command. I don't know why
    but I'll have to further research. I
    guess it worked for you, njrajesh, because your later
    version of Access implements SQL such that
    it accepts the original "create table."
    Thanks, njrajesh and DrClap, very much for your help.
    George

Maybe you are looking for