Eric
The fact that the calling bean is in the same directory as the .prp file
will not affect Java's notion of the "current" directory, which is normally
the directory you run the "java" command from. To be safe, try connecting to
jdbc:idb:c:/inetpub/wwwroot/WEB-INF/classes/SupportCentral/SupportCentral.pr
p
Regards
Peter Hearty
Lutris Technologies UK Ltd.
-----Original Message-----
From: Eric Advincula <eric07@earthlink.net>
To: instantDB@enhydra.org <instantDB@enhydra.org>
Date: 24 July 2000 21:04
Subject: 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
ileWriter( "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.
>
-----------------------------------------------------------------------------
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.
|