InstantDB Project
About InstantDB
Project Mail Lists
Short History
Reporting Bugs
Screen Shots
3rd Party Examples
FAQs

Software
Downloads
Documentation
CVS Repositories
Roadmap
License

About Enhydra.org
Who We Are
News, Articles & Events
Getting Involved
Contact Us

Community
Demos
Contributions
Resources
Case Studies
On The Edge! -NEW-
Commercial Vendors


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

InstantDB: Help with instantdb?


Windows 2000, IIS with resin, instantdb
Here is what I found:
It fails when I try to getConnection()

      _out.write( "\r\nForName" );
			Class.forName( "org.enhydra.instantdb.jdbc.idbDriver" );
      _out.write( "\r\nDriver" );
			conn = DriverManager.getConnection( "jdbc:idb:SupportCentral.prp" );
      _out.write( "\r\npass connect" );

Now my database is in the same location as the bean thats calling it:

c:\inetpub\wwwroot\WEB-INF\classes\SupportCentral
Any ideas on how to solve this?

The lib is in the resin\lib directory

Here is my code:


package SupportCentral;

import org.enhydra.instantdb.jdbc.*;
import java.sql.*;
import java.io.*;

public class Login implements java.io.Serializable
{
  Connection conn;
  Statement stmt		= null;
  ResultSet result 	= null;

  PrintWriter _out = null;

  public Login()
  {
  }


  private boolean Connect()
  {
    try
    {
      _out.write( "\r\nForName" );
			Class.forName( "org.enhydra.instantdb.jdbc.idbDriver" );
      _out.write( "\r\nDriver" );
			conn = DriverManager.getConnection( "jdbc:idb:SupportCentral.prp" );
      _out.write( "\r\npass connect" );
      return true;
    }
    catch( Exception err )
    {
      _out.write( "\r\nfailed connect" );
      return false;
    }
  }


  public boolean getUserExist()
  {
    try
    {
 			_out = new PrintWriter( new BufferedWriter( new FileWriter( "c:\\temp\\scentral8.txt", true )));
      _out.write( "test" );
      if( Connect() == true )
      {
        _strSQL = null;
        _strSQL = "SELECT Client.ClientID AS ClientID, Company.CompanyID AS CompanyID, Employee FROM Client, Company ";
				_strSQL += "WHERE Company.CompanyID = Client.CompanyID AND Password = '" + "password" + "' ";
				_strSQL += "AND UserName = '" + "sysadmin" + "' AND CompanyName LIKE '" + "Datalect" + "'";

        _out.write( _strSQL );
        _out.close();
	    	conn.close();
        return true;
      }
      else
      {
        _out.write("\r\nFaield" );
        _out.close();
        conn.close();
				return false;
      }
    }
    catch( Exception err )
    {
      System.err.println( err.getMessage() );
		  System.out.println( err );
		  err.printStackTrace();
      return false;
    }
  }

}

 

-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.