Database Connection Name

I m working in a company which is running multiple database. For example :
DATABASE1
DATABASE2
DATABASE3
I connect to these different databases at different times.
My Problem is, i want to change the SQL> prompt according to database. For example if i m connecting to database1 SQL > prompt should come like this : SQL DATABASE1> and for database2 it should come like SQL DATABASE2>.
How do i get this.
Please Help.
Thanks
Amit
I GOT THIS REPLY :
include this script in glogin file.
column db new_value mydb
set term off
select name db from v$database;
set sqlprompt '&mydb : SQL>'
set term on
Note: glogin.sql script will execute only when u invoke sqlplus.
it will not run when u connect using CONNECT command. you need select privilege on v$database view.
BUT THE PROBLEM IS :
i don't have this privilage, and i want to see this name using connect command then.

include this script in glogin file.
column db new_value mydb
set term off
select name db from v$database;
set sqlprompt '&mydb : SQL>'
set term on
Note: glogin.sql script will execute only when u invoke sqlplus.
it will not run when u connect using CONNECT command. you need select privilege on v$database view.
HTH
Suresh

Similar Messages

  • Dbxplorer dialog won't allow me to enter database connection name

    I'm trying to create a new database connection with dbxplorer. It pops up a dialog asking for the database connection name, but it won't accept any text input. I can't get any further without the ability to enter a name in this dialog.
    This is an existing project that was not created with any Workshop wizzards. I would still think that I could use dbxplorer on an existing project.
    Is there a way to make this work or a patch for this?

    We are actively working this issue and hope it will be resolved in our next release targeted for this summer.
    We are evaluating some workarounds, but there were some changes in the JDK that prompted this, and we are still assessing to see if related to jvm regression, api change, or a bug.
    Please use the older JDK as a workaround as an interim solution

  • Using different data source and connection name

    Hi,
    We have a requirement where the data source for our application is already configured on the server by name like MyDBDataSource. But the database connection name in our application is like My_DB. So application module is using data source name like My_DBDS. If i change data source name in application module configuration manually to be MyDBDataSource, then it fails at runtime. This has been identified as bug as mentioned in this post
    http://andrejusb.blogspot.in/2009/01/practical-adf-security-deployment-on.html
    Is this still valid? I am using 11.1.1.6 version. Also want to know if there is any workaround for this ? If i change the name in web.xml at deployment time using script, will it work ?
    Thanks

    Hi Ami,
    Is your issue get solved ?
    I would like to mention few things about the database connection in application & data source in Weblogic.
    1. When you create a database connection in Application (for example say connection name as hr) then in the Application Module Database Configurations in the bc4j.xcfg File Custom JDBCDataSource will be set as <Custom JDBCDataSource="java:comp/env/jdbc/hrDS"/> for both ApplnModule shared & Local. So when you create data source in weblogic it is better to create the JNDI Name like jdbc/hrDS ( ie between the '/' and 'DS' you have to specify the name of database connection you created in the application ).What ever the Data source name is no matter.
    2.If you change the JNDI name of data source later like jdbc/hrconnectionDS then it is better to delete the old hr connection from application and recreate a connection as hrconnection. After that you have to edit bc4j.xcfg file in the Application Module--> Configurations and set Custom JDBCDataSource as below for both local & shared config.
    <Custom JDBCDataSource="java:comp/env/jdbc/hrconnectionDS"/>
    I hope this will help you.
    Gijith.

  • Database connection variable is not well defined

    The following error message is in SIL_InsertRowInRunTable.log in Informatica WorkflowLogs directory
    Can someone help me to look where to start to troubleshoot?
    Thanks
    ERROR : TM_6292 : (4836|3912) Session task instance [SIL_InsertRowInRunTable]: TM_6193 [Error occured during expansion of DB connection parameters [Database connection name DataWarehouse for database connection variable $DBConnection_OLAP is not well defined.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    hello ALL.
    My DAC client and Informatica client is on windows and DAC server and Informatica is on Linux.
    I am getting similar issue:
    D:\OracleBI\DAC\ServerLog
    12 SEVERE Wed Feb 18 14:22:43 PST 2009 Starting ETL Process.
    13 SEVERE Wed Feb 18 14:22:48 PST 2009 Informatica Status Poll Interval new value : 20000(milli-seconds)
    14 SEVERE Wed Feb 18 14:22:52 PST 2009 /d01/OracleBIApps/DAC/Informatica/parameters/input/FLAT FILE specified is not a currently existing directory
    15 SEVERE Wed Feb 18 14:22:53 PST 2009 Request to start workflow : 'SILOS:SIL_InsertRowInRunTable' has completed with error code 7
    16 SEVERE Wed Feb 18 14:22:54 PST 2009 ETL seems to have completed. Invoking shut down dispatcher after the notification from the last running task.
    17 SEVERE Wed Feb 18 14:22:54 PST 2009 Finishing ETL Process.
    18 SEVERE Wed Feb 18 14:22:54 PST 2009 MESSAGE:::Some steps failed.
    EXCEPTION CLASS::: com.siebel.etl.engine.bore.SomeSessionsFailedException
    I have made sure that everything that ED has mentioned, i have checked still can't resolve the issue.
    in my WorkflowLogs/SIL_InsertRowInRunTable.log (according to this error, i have placed the required parameters files in the SrcFiles and LkpFiles. but still, the ETL process is being stuck at first step).
    this is the error i found:
    INFO : LM_36435 [Wed Feb 18 12:06:13 2009] : (25894|-1589191776) Starting execution of workflow [SIL_InsertRowInRunTable] in folder [SILOS] last saved by user [Administrator].
    INFO : LM_44195 [Wed Feb 18 12:06:13 2009] : (25894|-1589191776) Workflow [SIL_InsertRowInRunTable] service level [SLPriority:5,SLDispatchWaitTime:1800].
    INFO : LM_36388 [Wed Feb 18 12:06:14 2009] : (25894|-1589191776) Session task instance [SIL_InsertRowInRunTable] is waiting to be started.
    INFO : LM_36682 [Wed Feb 18 12:06:16 2009] : (25894|-1589191776) Session task instance [SIL_InsertRowInRunTable]: started a process with pid [14937] on node [node01_osirhdev12.osius.com].
    INFO : LM_36330 [Wed Feb 18 12:06:16 2009] : (25894|-1589191776) Session task instance [SIL_InsertRowInRunTable]: Execution started.
    ERROR : VAR_27086 : (25894|-1578701920) Cannot find specified parameter file [d01/Informatica/PowerCenter8.1.1/server/infa_shared/SrcFiles/SILOS.SIL_InsertRowInRunTable.txt] for [session [SIL_InsertRowInRunTable.SIL_InsertRowInRunTable]].
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6793 Fetching initialization properties from the Integration Service. : (Wed Feb 18 12:06:23 2009)]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [DISP_20305 The [Preparer] DTM with process id [14937] is running on node [node01_osirhdev12.osius.com].
    : (Wed Feb 18 12:06:23 2009)]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [PETL_24036 Beginning the prepare phase for the session.]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6721 Started [Connect to Repository].]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6722 Finished [Connect to Repository]. It took [0.24927] seconds.]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6794 Connected to repository [PowerCenter] in domain [Domain_osirhdev12.osius.com] user [Administrator]]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6721 Started [Fetch Session from Repository].]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6722 Finished [Fetch Session from Repository]. It took [16.3948] seconds.]
    INFO : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [TM_6793 Fetching initialization properties from the Integration Service. : (Wed Feb 18 12:06:40 2009)]
    ERROR : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [CMN_1761 Timestamp Event: [Wed Feb 18 12:06:40 2009]]
    ERROR : LM_36488 [Wed Feb 18 12:06:40 2009] : (25894|-1599681632) Session task instance [SIL_InsertRowInRunTable] : [PETL_24049 Failed to get the initialization properties from the master service process for the prepare phase [Session task instance [SIL_InsertRowInRunTable]: Unable to read variable definition from parameter file [d01/Informatica/PowerCenter8.1.1/server/infa_shared/SrcFiles/SILOS.SIL_InsertRowInRunTable.txt].] with error code [4].]
    ERROR : LM_36320 [Wed Feb 18 12:06:42 2009] : (25894|-1589191776) Session task instance [SIL_InsertRowInRunTable]: Execution failed.
    WARNING : LM_36331 : (25894|-1589191776) Session task instance [SIL_InsertRowInRunTable] failed and its "fail parent if this task fails" setting is turned on. So, Workflow [SIL_InsertRowInRunTable] will be failed.
    ERROR : LM_36320 [Wed Feb 18 12:06:42 2009] : (25894|-1589191776) Workflow [SIL_InsertRowInRunTable]: Execution failed.
    IF any one had similar issues, please reply to this.
    Thanks

  • Changing database connection details aftre WAR file deployment

    Hello,
    I create a WAR deployment file and distribute this to a Tomcat web container. The package unpacks as expected however the production database details are different from my devlopment environment. The database connection name is the same. I thought if I simply change the connection details in the connections.xml file and restart the web app this would do the trick. It does not. What am I missing?

    Maybe your application is using a connection as defined in data-sources.xml. Check there.

  • Question to Steve - connection names

    Currently we are looking for a way to give concurrency control in a XSQL application to our users.
    Our Scenario is (in 2 browser sessions):
    User A : select * from xy where key = 'ABC' for update
    User B : select * from xy where key = 'ABC' for update
    Our test results are:
    User A: connection="conn1" (scott/tiger@localhost:1521:ORCL)
    User B: same connection name as User A
    -> no error (probably because it's the same transaction?)
    User A: connection="conn1" (scott/tiger@localhost:1521:ORCL)
    User B: connection="conn2" (scott/tiger@localhost:1521:ORCL)
    -> error as wanted
    (By the way: this behaviour changed from XSQL 1.0.3.0 to XSQL 1.0.4.3. If autocommit=true we get an error "fetch from an already closed cursor". So we have to set autocommit=false here.)
    Our plan is to define 50 or more named connections in XSQLConfig.cml pointing to the same database and the same oracle user.
    The pre-login page will use one standard connection. After successful authenticating the user we do a "Select for update" on a table which contains the 50 connections names, too, and connect the user in all future pages with his own "connection".
    Are we far out with this approach ?
    Or can we reach the same result easier ?
    Thank you for your help.
    Andreas
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Andreas Saake ([email protected]):
    We want to implement in this way a successor for our client/server-based legacy application. It will run only in intranets, but many users work over ISDN lines.
    Today we use MS Terminal Servers to achieve the accessibility.
    The XSQL servlet is our choice because of
    the very well-design structure, best integration capabilites via Java (if neccessary), the content rich HTML pages and the capability to do our business logic in the well known PL/SQL.
    A detail case: A user opens an item record and wants to edit it. Other users shall not have the right to do similar work on the same item.
    Without this technique we see lost update problems if not impelementing a manual timestamp access mechanism.
    In the described case we know the maximal number of users for our application, so we could implement enough database connection names.
    Would you propose another way for this application intention ?
    Andreas<HR></BLOCKQUOTE>
    You could use the newest version of DB Prism which uses JDBC 2.0 extended API to manage transaction by URL demarcation.
    This new functionality use the same physical connection but independent transaction over JTA specification.
    Look at this demo on-line, if you open a new browser with the link opened session/transaction you could see that same connection reuses scott's connection but open a new branch transaction.
    This transaction support by url demarcation works as OAS transaction support.
    Best regards, Marcelo.

  • Why do I get a class conflict between the Prepare SQL.vi and the Get Column Name.vi with the SQL Toolkit compatibility vis from the Database Connectivity Toolkit?

    I have done extensive programming with the SQL Toolkit with LabVIEW versions through 6.1. My customer now wants to upgrade to Windows 7, so I am trying to upgrade to LabVIEW 2009 (my latest purchased version) using the Database Connectivity Toolkit, and the SQL Toolkit Compatibility vis. Everything seemed to be going okay with the higher level SQL operations, but I ran into trouble with the Get Column Name.vi. 
    The pictures below show the problem. The original SQL Toolkit connected the Prepare SQL.vi with the Get Column Name.vi with a cluster of two references, one for connection, and one for sql. The new compatibility vis have a class conflict in the wire because the Prepare SQL.vi contains a cluster with connection, and command references, but the Get Column Name.vi expects a cluster with connection and recordset references. 
    How do I resolve this conflict?
    Thank You.
    Dan

    I've never worked with the old version of the toolkit, so I don't know how it did things, but looking inside the SQL prep VI, it only generates a command, and the the column name VI wants a recordset. I'm not super familiar with all the internals of ADO, but my understanding is that is standard - you only have the columns after you execute the command and get the recordset back. What you can apparently do here is insert the Execute Prepared SQL VI in the middle and that will return what you need.
    I'm not sure why it worked before. Maybe the execute was hidden inside the prep VI or maybe you can get the column names out of the command object before execution. In general, I would recommend considering switching to the newer VIs.
    Try to take over the world!

  • Set SSIS variable = database connection manager name

    Is it possible to set a SSIS string to only the name of a database connection manager or even the connection string it uses ? I don't see an option for that in Evaluate as expression property of ssis variable.
    This is what I mean - 
    SSIS Connection manager name = SQL_DBASE
    SSIS String str_managerName = SSIS Connection manager name: Can you do this dynamically in SSIS ?

    I'm guessing what they really want to do is evaluate some indicator (some input from a user or an infrastructure setting) and then dynamically connect to any one of 10 (arbitrary example) database servers based on what they get as input.  They
    don't care about the connection manager per se.  What seems reasonable is the that the Connection Manager might take a server variable but if they wanted to do things like that they would have bought Datastage.
    You might try attacking this problem at the Control Level and then connect to the database you want based on a variable you set.   I'm seeing that a Sequence Container can branch on the contents of a variable. 
    Or if the dba is your friend you might get the dba to add all your servers as linked servers to a central connection machine and then you might be able to do this by putting the ssis variable in a "Sql Command from a Variable" variable. 
    It might look something like this:
    Server is designated in ssis var @[User::Machine]
    then executing from a variable
    "select top 100 * from " + @[User::Machine] + ".mydb.dbo.mytable"
    Be careful as hades about levels of indirection and what quotes you want at what level.  Evaluate Expression in ssis helps with this.  The syntax I show works only with an ms sql connection server to a remote ms sql server.  This is what a
    dynamic connection to a linked server connection to Oracle would look like:
    "select * from
    openquery("+ @[User::Machine] + ",'select * from oradb.oratable where rownum < 100')"
    When ever a thousand of your best friends are helping you connect to your database (using tools like linked servers as opposed to direct connections) it's probably best to use with only small specific updates or queries, large queries or large
    updates would probably take a long time and or might not finish.  But try it before you give up.   We are actually doing fairly large Oracle queries (5-10 million rows) through ms sql linked server.

  • How to discover the database vendor Name of the default connection

    Im getting a db connection via context.lookup() to the default schema (SAPDB) and I want to discover the J2EE database vendor Name.
    can anyone help me?
    Regards
    Armando

    Hi Prakash:
    I tried that code and I get "SAP DB", but if I change the method using JDBC (not JNDI) with SQL server JDBC driver, I get null for getDatabaseProductName() method, I don´t now if using JNDI would be different since i don´t have any Web AS Java installed for SQL Server.
    I have this Code:
    Properties prop = System.getProperties();
    Context context = new InitialContext();
    DataSource ds;
    Connection con;
    String sysname = prop.getProperty("SAPSYSTEMNAME");
    String DataSourceName = "jdbc/SAP" + sysname + "DB";
    String dummyNull = "";
    try {
         ds = (DataSource) context.lookup(DataSourceName);
    catch (Exception e) {
         throw new HibernateException( "Could not find datasource", e );
    con = ds.getConnection();
    And When I inspect in debug Mode the con object
    I get this:
    "con"= CommonConnectionHandle  (id=279)
    ___mc= CommonManagedConnectionImpl  (id=295)
    ______con= CommonConnectionImpl  (id=286)
    _________connectionContext= CommonContextFactory$CommonConnectionContextImpl  (id=333)
    ____________dataSourceContext= ContextFactory$DataSourceContextImpl  (id=356)
    _______________databaseName= "C14"
    _______________dataSourceName= "SAPC14DB"
    _______________serverName= "ARMANDOALONSO.neoris.cxnetworks."
    _______________sqlType= 1
    _______________userName= null
    _______________vendorID= 6
    _______________vendorName= "SAPDB"
    ____________userName= "SAPC14DB"
    the data that I want to access is (vendorName= "SAPDB")
    and I dont know how to do that.

  • [Bug] Or feature? Database connection closed if given a name after first op

    I am not sure if this is a bug or a feature.
    oracle.javatools.db.Database db = oracle.javatools.db.DatabaseFactory.findOrCreateDatabase("sample", conn);
    If I supply a name for the database as the above line using "sample", the database connection is closed after the first op, i.e., you can call
    db.listObjects once, but the second time, it will fail with StackOverFlowException. But the culprit is the database connection is closed after the first op.
    However, if I don't give it a name, using null,
    oracle.javatools.db.Database db = oracle.javatools.db.DatabaseFactory.findOrCreateDatabase(null, conn);
    There's no problem at all.
    Is this a bug or a feature?
    If a feature, the JavaDoc made it worse, by using the following example:
    http://www.oracle.com/technology/products/jdev/esdk/api1013/oracle/javatools/db/DatabaseFactory.html
    The DatabaseFactory should be used over the DBObjectProviderFactory when a Database specifically is required, and the name and Connection of that Database are available.
    e.g.
    java.sql.Connection conn = // the Connection to the db
    DatabaseFactory.findOrCreateDatabase( "ora10g", conn );
    The example sure sounds like a name is mandatory. Or perhaps the name is not some random name, but TNSName? If so, the Doc should certainly mention that.

    I am not sure if this is a bug or a feature.
    oracle.javatools.db.Database db = oracle.javatools.db.DatabaseFactory.findOrCreateDatabase("sample", conn);
    If I supply a name for the database as the above line using "sample", the database connection is closed after the first op, i.e., you can call
    db.listObjects once, but the second time, it will fail with StackOverFlowException. But the culprit is the database connection is closed after the first op.
    However, if I don't give it a name, using null,
    oracle.javatools.db.Database db = oracle.javatools.db.DatabaseFactory.findOrCreateDatabase(null, conn);
    There's no problem at all.
    Is this a bug or a feature?
    If a feature, the JavaDoc made it worse, by using the following example:
    http://www.oracle.com/technology/products/jdev/esdk/api1013/oracle/javatools/db/DatabaseFactory.html
    The DatabaseFactory should be used over the DBObjectProviderFactory when a Database specifically is required, and the name and Connection of that Database are available.
    e.g.
    java.sql.Connection conn = // the Connection to the db
    DatabaseFactory.findOrCreateDatabase( "ora10g", conn );
    The example sure sounds like a name is mandatory. Or perhaps the name is not some random name, but TNSName? If so, the Doc should certainly mention that.

  • Connect Database Host Name in Oracle Rac Database

    Hi All,
    I am using Oracle SES 11g to create a "Table Source" and a have following question.
    I have to added new table source to crawl, in the field "Database Host Name" i want to connect with Oracle Rac Database Server with two node.
    I am searching in the document and i can't find any relevant on that scenario.
    Can anyone help me in that ?
    Thank you.
    NG

    Check this Rittman Mead Consulting &amp;raquo; Blog Archive &amp;raquo; Oracle BI EE 11g – Managing Host Name Changes

  • Name of the database connection

    When I create a new datasource in JSC and then deploy my application, I find that the JSC creates a database connection called, in my case:
    jdbc/decsis_RaveGenerated_1088606994
    Why the RaveGenerated plus the number? I would just want it to be called jdbc/decsis. Can this be changed so it remains the same always without that extra characters? Thank you.
    Franklin Angulo

    No. That is not how it is working... An example: I took my .war application to another company, then installed an application server with a the following database connections:
    Connection Pool: DecsaPool
    Resource: jdbc/decsis
    When I run my application, it gives me the error that it doesn't find the jdbc/decsis_RaveGenerated10906100xxxx. So I go to my Application Server and under Resources create a new one with the same name as it asks me in the error and make it refer to the DecsaPool Connection Pool. And then my application works fine.
    I found that I could modify the sun-web.xml after my application builds to change that name to just jdbc/decsis. But when I clean my project that information would disappear and then when I build again I would have to modify the sun-web.xml again. So is there a way to modify this so it never gives me the RaveGenerated part at all? Thank you.
    Franklin Angulo

  • Can not find Function module in Crystal Report Database Connections FN

    Hi,
    we designed a Function Module XX in SE80.
    We set up BO Interagtion for SAP
    We can connect to the R3( CRM) System.
    We can See FN's.
    We can not see our Function Module XX we designed in SE80 in the Database Connection
    What is missing ?
    Any Authorization missing ?
    Which Where
    Thanks
    Martin Sautter

    Yes,
    we just have got it:
    /Database Assistant / Data / My Connections/<myConnection>/FN -> Right Mice Button/ Options ->  Table Name Like: <MYTABLE>
    than
    /Right Mice Button/Regenerate
    Thanks
    Martin

  • Creating new Data Source Error - Database connection Failed

    Successfully installed and configured 11.1.1.3.0. Planning and Essbase dev.
    Went to Workspace > Administer > Classing Planning Administration > Manage Data Sources > Create Data Source.
    Entered all info about the application database , etc. Getting error "The database connection failed" (I was able to connect with no problem during the install)
    SQL server 2005 is on the same physical server.
    The diagnostic tool shows database connection passed for planning. A new database was created for the new application.
    The server event viewer shows these errors.
    "Login failed for user 'xxx-hyperion'. The user is not associated with a trusted SQL Server connection."
    Group Policy Error "The client-side extension could not apply computer policy settings for 'Default Domain Policy {xxx}' because it failed with error code '0x80070003 The system cannot find the path specified.' See trace file for more details. "
    The Group Policy client-side extension Group Policy Services failed to execute. Please look for any errors reported earlier by that extension.
    Any help is appreciated.

    Datasource for the application.
    I have created a sql db for this planning application (my datasource). See my first message for more details.
    When you create a new planning application, you need to associate it with a data source. Since this is a new install, I don't have any data sources available yet.
    So, "To create, edit or delete data sources, click Manage Data Source."
    This page lets you validate your connection to the database and essbase server. My essbase server connection validates! The database connection does not validate after I enter all the relevant information.
    SCREEN INFO BELOW
    Fields displayed with an asterisk (*) are mandatory.
    Data Source Name *:
    Data Source Description:
    Select Database Platform
    Microsoft SQL Server
    Application Database
    Server * :
    Port * :
    Database *:
    User *:
    Password *:
    Click "Validate Database Connection"
    ERROR ---> Database connection failed.
    So it does not let me create a data source for my new planning application, so I cannot create a new planning application.
    Thanks in advance.

  • J2EE Struts - Database connection failed - help???:(

    Hello,
    I have built a little web application and it works without any problems. In the next step I tried to add a database connection but I have already worked on it for at least one day and I could not fix the problem with the database connection.
    I downloaded the MySQL Server 5.0 and installed it, furthermore I have downloaded the jdbc driver mysql-connector-java-3.1.11.zip and extracted it to the MySQL Server 5.0 directory. Furthermore I have added under system settings - system - etended - system variables the whole path to the driver -> C:\Programme\MySQL\MySQL Server 5.0\mysql-connector-java-3.1.11\mysql-connector-java-3.1.11-bin.jar to the CLASSPATH systemvariable.
    Then I have startet the SQL Server 5.0 with mysqld --console from the command line.
    Furthermore I have added under Project-Properties-Java Build Path - Libraries - Add External JARs in Eclipse the mysql-connector-java-3.1.11-bin.jar to my Struts WebProject.
    To test the whole thing I have added to the existing test-database from mysql a table named owner and wanted to test the database connection in the Action-class with the following statements - I quote the whole execute method of the OwnerAction class:
    public ActionForward execute(
                     ActionMapping mapping,
                     ActionForm form,
                     HttpServletRequest request,
                     HttpServletResponse response)
                     throws Exception {
                   OwnerForm ownerForm = (OwnerForm) form;
                   String greet = ownerForm.getGreet();
                   String name = ownerForm.getName();
                   request.setAttribute("name", name);
                   request.setAttribute("greet", greet);
                   String address = ownerForm.getAddress();
                   String email = ownerForm.getEmail();
                   int tel = ownerForm.getTel();
                   Connection conn = null;
                   Statement stmt = null;
                   ResultSet rs = null;
                   DriverManager.registerDriver(new org.gjt.mm.mysql.Driver());
                   conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","sa");
                   try {
                         //conn = dataSource.getConnection();
                         stmt = conn.createStatement();
                         int id = 0;
                         rs = stmt.executeQuery("select max(id) as counter from owner");
                         while(rs.next()){
                            id = rs.getInt("counter");
                         id += 1;
                         stmt.executeUpdate("insert into owner values("+id+", '"+greet+"', '"+name+"', '"+email+"', '"+address+"', "+tel+")");
                         rs.close();
                         stmt.close();
                         conn.close();
                      catch(SQLException e){
                         throw new SQLException("database error");
                      // Forward control to the specified success target
                      return (mapping.findForward("success"));
          }But when I execute the WebApplication and the Action will be called the following error message appears in the browser:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
    root cause
    java.lang.NoClassDefFoundError: org/gjt/mm/mysql/Driver
         com.asprise.struts.action.OwnerAction.execute(OwnerAction.java:72)
         org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.
    It must depend with anything that the driver was not found but I have defined it in the CLASSPATH variable and added it to the Web-Project in eclispe.
    Has anybody an idea what I have else made wrong or have forgotten??:(:(:(
    thanks in advance
    lg
    pat

    One thing I have forgotten - I have also copied the mysql-connector-java-3.1.11-bin.jar in the WebRoot\WEB-INF\lib directory of my EasyStruts WebApplication.
    Can anything else be wrong??:(:((
    regards

Maybe you are looking for

  • Do games run better when played using windows xp?

    i was wondering if games run better if you have windows xp on your macbook?

  • Problems with the Calendar in Palm Desktop 6.2

    Hi, The Palm Desktop don't show me the Birthdays in the Calendar, I used the older version of the Palm Desktop and they appeared but not now.  Con you give me a reason for this? Thanks! Mariano

  • [b]APEX Meetup at ODTUG[/b]

    Hello, For those folks going to ODTUG, we (Monty, Bharat and a few others) are trying to arrange an APEX Meetup (if you've never been to one before it's very casual, usually in a bar - drinks and good chat). I posted a quick blog post - http://jes.bl

  • Php module in apache doen't load

    I've tried to get php running on the apache server on leopard. I've modified the httpd.conf to load the php5 module (removed the #) but when i open a php file, the screen is blank, and the source shows the php code. I tried to stop and restart the we

  • Will FCP support the new Sony V1U

    I'm considering buying the soon to be released Sony V1U. Does anyone know if this camera will be supported by Final Cut right away or will we have to wait for NAB for an update? Thanks, Anne