Here is a snippet from the code we use to test (don't know about
username/password. . .Sorry):
private void openSession()
throws SQLException, Exception
{
try
{
//Register the Oracle jdbc Driver
Class.forName("oracle.jdbc.driver.OracleDriver");
//If necessary:
//DriverManager.registerDriver( new
oracle.jdbc.driver.OracleDriver() );
//Open session
Connection cnx =
DriverManager.getConnection("jdbc:oracle:thin:@<hostname>:<port>");
}
catch (SQLException sqle)
{
sqle.printStackTrace();
}
}
private void closeSession()
throws SQLException, Exception
{
try
{
//Close session
cnx.close();
}
catch (SQLException sqle)
{
sqle.printStackTrace();
}
}
----- Original Message -----
From: "mike thomas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 26, 2001 1:19 PM
Subject: JDBC connecting to Oracle
> Hi all
>
> Does anyone out there know the syntax for
> connecting a JSP to an Oracle database using JDBC?
> What I am really after is how do I set the
> database name, user name and password so that JSP
> can set up the connection. So far I have this :-
>
> Connection con =
> DriverManager.getConnection("??");
>
> Apologies if this is off the topic for this group
>
> Thanks
>
> Michael Thomas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]