Help connecting to SSM Database

Good day SSM Geeks,
Again another question..., hope you guys can help me.
How do I connect to SSM Database?
I need to extract a table with all the initiatives by context (containing: Owner (Team), Budget, Schedule, Target End, Comments, etc..)
We are developing a web solution to improve the Milestones and Sub-milestones of initiatives component.
Again, any help with it, Iu2019ll appreciate.
Frederick

Hi
1.- Try to type MSTSC in Windows Execute Command (Run window)
2.- Name of remote desktop -> connect
3.- Username and Password required (probably the same you are using as administrator)
4.- Once in remote desktop, open Application Server Administration. You should see all tables, processes...
I hope it helps

Similar Messages

  • Need help connecting to a database with an applet

    I am making a Java game that runs in an applet and needs to connect to a Java DB database. I created the database and table in NetBeans and now I have no idea how to connect this applet to the database. I tried using a DataSource and an InitialContext and I got a NoInitialContextException. Any help would be appreciated thanks.

    Already made the InitialContext. This is the code I used in the applet:
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("jdbc:derby://localhost:1527/GameDatabase");
    Connection con = ds.getConnection();
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM Scenery");

  • Newby Needs Help Connecting to Oracle Database

    I'm very very new to java. I'm trying to write a program to connect to and read some fields in an oracle table. I'm having problems and am not sure how to correct it. I downloaded and installed the oracle thin driver. I'm using Eclipse 3.3 and JRE 1.6. This is my code:
    import java.sql.*;
    public class One {
         public static void main(String[] args) {
              try {
                   DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                   System.out.println("let's connect");
                   Connection conn=DriverManager.getConnection(
              "jdbc:oracle:thin:@a571p05.pt.com:1521:orap1","username","password");
                        System.out.println("I'm connected");
                        Statement stmt=conn.createStatement();
                        ResultSet rset=stmt.executeQuery(
                             "select CUSTNUM,CUST_LNAME from TBL.CUSTOMER where " + "CUSTNUM=\"12345678900\"");
                   System.out.println("Result set?");
                   while (rset.next())
                        System.out.println(rset.getString(1)); //Print col 1
                   stmt.close();
              catch(Exception x) {
                   System.out.println("Unable to connect!");
              System.exit(0);
    If I just run it, this is the output:
    let's connect
    I'm connected
    Unable to connect!
    So, it looks like it may be connecting, at least it runs the line that establishes the connection then the next line which prints a comment. However, it seems to fail at some point thereafter. I've tried debugging it and as far as I can tell, it's erroring out on thie line:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    with this stack trace:
    Thread [main] (Suspended)     
         ClassNotFoundException(Throwable).<init>(String, Throwable) line: 217     
         ClassNotFoundException(Exception).<init>(String, Throwable) line: not available     
         ClassNotFoundException.<init>(String) line: not available     
         ClassLoader.findBootstrapClass(String) line: not available [native method]     
         Launcher$ExtClassLoader(ClassLoader).findBootstrapClass0(String) line: not available     
         Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: not available     
         Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available     
         Launcher$AppClassLoader.loadClass(String, boolean) line: not available     
         Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available     
         Launcher$AppClassLoader(ClassLoader).loadClassInternal(String) line: not available     
         One.main(String[]) line: 8     
    I checked the project properties\java build path and I have JDBC_THIN_DRIVER and JRE_SYSTEM_LIBRARY listed there. Do I need something else? I'm not quite sure what I'm missing or what the errors are telling me. Any help, or pointers are appreciated. Thanks much!

    I would write that class more like this, assuming that customer ID is a String:
    import java.sql.*;
    public class One
       private static final String DEFAULT_DRIVER = "com.oracle.jdbc.Driver";
       private static final String DEFAULT_URL = "jdbc:oracle:thin:@a571p05.pt.com:1521:orap1";
       private static final String DEFAULT_USERNAME = "username";
       private static final String DEFAULT_PASSWORD = "password";
       private static final String SQL = "select CUSTNUM,CUST_LNAME from TBL.CUSTOMER where CUSTNUM=?";
       private static final String DEFAULT_CUSTOMER_ID = "12345678900";
       public static void main(String[] args)
          Connection conn = null;
          PreparedStatement stmt = null;
          ResultSet rset = null;
          try
             Class.forName(DEFAULT_DRIVER);
             conn = DriverManager.getConnection(DEFAULT_URL, DEFAULT_USERNAME, DEFAULT_PASSWORD);
             stmt = conn.prepareStatement(SQL);
             String customerId = ((args.length > 0) ? args[0] : DEFAULT_CUSTOMER_ID);
             stmt.setString(1, customerId);
             rset = stmt.executeQuery();
             while (rset.next())
                System.out.println(rset.getString(1));
          catch (Exception x)
             x.printStackTrace();
          finally
             close(rset);
             close(stmt);
             close(conn);
       private static void close(Connection conn)
          try
             if (conn != null)
                conn.close();
          catch (SQLException e)
             e.printStackTrace();
       private static void close(Statement stmt)
          try
             if (stmt != null)
                stmt.close();
          catch (SQLException e)
             e.printStackTrace();
       private static void close(ResultSet rset)
          try
             if (rset != null)
                rset.close();
          catch (SQLException e)
             e.printStackTrace();
    }%

  • Dw cs5 with existing wordpress site hosted on yahoo need help connecting to existing remote database

    I am having trouble establishing a database connection.  I can  connect with test databases but am having trouble using dreamweaver wtih  my existing wordpress website.  Am I able to use dreamweaver to edit  and live view my changes before uploading the changed files to my live  site?  Am I able to access my existing wordpress database with  dreaweaver?  I have imported it to my testing server/database but still  seem to be having trouble establishing a connection with it (think maybe  my folder hierarchy might be off).
    macintosh HD/Applications/MAMP/htdocs/nwm/wp/index.php
    "nwm" is the name of the folder that I have copied all of my site  files to and the folder I have dreamweaver pointing to.  "wp" is what I  have all of the wordpress files in (the ones I copied from my yahoo  server - including all my current theme files etc.)
    I am trying to put the info into the mysql connection dialog box:
    Connection Name: Testing (i am assuming this name is for my benefit only and doesn't actually matter)
    MySQL Server: mysql
    User Name: *****
    Password: *****
    Database: wp
    and am getting this message
    MySQL Error#: 2013
    Lost connection to MySQL server at 'reading initial communication packet', system error 61
    did some google seaches of the error.  Tried turning off the  firewall, and the advance tab allow mysql incoming  (there were 2 one  was allow one was not allow.  I changed both to allow)
    Cant really find anything on yahoo to help me out.  Looked in  phpmyadmin database named wp: wp_users to get the username and password  (which due to previous look for help - I think the password was  encrypted cuz it looked like a bunch of mumbo jumbo and am fairly  certain I know the correct password).
    Any help would be greatly appreciated!! I spent $50 on live chat  last night trying to resolve the issue only to find out at the end that  the guy really didn't understand my problem and doesn't have  dreamweaver.  I have also watched countless videos on Lynda.com and have  been thru forum after forum.  While this problem is only a couple weeks  old since I just got CS5.  I have been having trouble making any  headway learning php since I cant seem to make it past the set up  parts.  I have done the php / mysql essential training on lynda.com with  relative success except that I really dont want to work with any more  exercise files so I didn't go on to the beyond the basics. I recently  went thru most of the Dreamweaver CS5 and Wordpress 3. Also did the  first 4 chapters of Dreamweaver CS5 with PHP and MySQL. I need to start  integrating things into my live sites.  I am also trying to work my way  thru the learning php, mysql, javascript book by o'reily media by robin  nixon (as fun as reading a math text book) can't get thru it since I  can't relate any of it to my current sites/needs
    I am on MacBookPro OSX 10.6.6
    Installed MAMP to specification on all 20 tutorials I have tried including lynda.com
    Tested the testing server and is working
    Just installed dreamweaver cs5
    have been using wordpress online to create and edit posts (recently  upgraded to 3.? whatever the latest update was online which I believe  update the files on my yahoo server?)
    Have also installed wordpress on my computer (several times thru each tutorial trying to get this right.)
    Am I expecting the impossible?

    If wordpress controls it's own connection why am I unable to use the live view. I have synced the remote site to my local computer so all the files should be just as they are online with the exception of the DB which contains most of the content.
    I have done all of those steps.  I have even exported the database from inside internet phpmyadmin and imported into computer phpmyadmin.  When I hit live view I get one of couple of errors.
    1.  "One is that the dynamic related files could not be displayed due to an internal server error"
    At some point I was able to view some sample files inside dreamweaver.  But I would like to be able to view my real site files.  I was able to "connect" to the local databases (not the copy of my real one - I think that maybe that was because it is somehow nested inside another db an am going try to reimport to new location).  And then I changed the host/username/password trying to deal with the internal server error. Now instead I get the cannot connect to the database Error 2016 or whatever from the origianl post. Also, I am using yahoo if that matters and all I can find about what their server name is: mysql - is that correct?
    I have been thru this so many times with so many different tutorials I am losing track of what is what.
    2.  Can I access my remote database within dreamweaver? I do not want to create dummy files (seems to be a waste of time).  And while if it had worked exporting/importing a duplicate on to my computer would have satisfied me for a little while it also seems some what counter productive.  Since every post and page is different if I were doing a daily updates etc how would I be able to change the formating or design of them if I can't access the remote files.  Would I re- import everytime I want to work on it to get current database?
    I am trying to be clear.  I listed all the specs I could think as listed  in your "how to get help fast post" (yes I read that at least twice  too) of all of the steps and possible reasons for my problems.  I also  thought that the forum was on a seperate site so I didn't think it would  count as a duplicate.  I am frustrated to tears and am feeling  incredibly stupid that after all this time and all these tutorials yes  you are right I obviously am not understanding what is going on which is  why I am on this forum.

  • Help needed in connecting to oracle database in unity

    Hi,
    I have been trying to connect to Oracle database in my codes. I have tried using OdbcConnection and OleDbconnection. But both did not allowed me to connect to the database. The database, testDb, can be accessed using SQL plus as well as the SQL developer. I even tested the connection successful using ODBC data source administrator.
    the following is my code for the connection string:
    OdbcConnection connectionString = "Driver={Oracle ODBC Driver};Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP )(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=Te stDb)));Uid=scott;Pwd=password;";
    the error i got is [ODBC Driver Manager] Data Source name not found and no default driver specified.
    for the driver parameter, i have tried using "Microsoft ODBC for Oracle". It gives me another error stating that the oracle and network components are not installed.
    I even tried "Oracle in OraDb11g_home1" which was specified in the ODBC Data Source Administrator. The same error came out.
    Below are some of my specifications:
    Platform: Windows 7 64bit
    Oracle: Oracle Database 11g Release 2 (64bit)
    Unity: 4.1.2
    Can someone please help me with this? What is it that i have done wrong?
    Thanks.

    1008737 wrote:
    Hi,
    I have been trying to connect to Oracle database in my codes. I have tried using OdbcConnection and OleDbconnection. But both did not allowed me to connect to the database. The database, testDb, can be accessed using SQL plus as well as the SQL developer. I even tested the connection successful using ODBC data source administrator.
    the following is my code for the connection string:
    OdbcConnection connectionString = "Driver={Oracle ODBC Driver};Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP )(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=Te stDb)));Uid=scott;Pwd=password;";
    whenever localhost (127.0.0.1) is used, this means that no remote client can ever connect to this system
    The problem involves ODBC configuration & has nothing to do with Oracle.

  • Need Help Connecting Crystal XI to Progress Database

    Post Author: leomclaughlin
    CA Forum: Data Connectivity and SQL
    I am new to Crystal Reports and need some help figuring out how to connect to my database. I am using Crystal Reports XI and the database is Progress ver 91 (at least as best I can tell, anyway).
    Thanks in advance!

    Post Author: elowell
    CA Forum: Data Connectivity and SQL
    First you need to make sure you have the proper OBDC driver installed so Windows knows where to look. What OS is on your desktop?

  • Need help connecting to database on website!!!!

    Hi there
    I am doing a school project and have decided to make a database which i can store user info and car info (its a car auction program)
    But i am having trouble with the connection to the database... we have been told to use jdbc odbc connection so is there a way to use this method to connect to my database?
    this is my connection code when connecting to the database locally:
    con = DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=CarDealership.accdb");
    i omitted the other code because it is pretty standard code to do this connection.
    But now i want to connect to a database of the same name on this site:
    sites.google.com/site/card3al3rsh1p
    what must i change in my code to be able to connect to the database on the internet????
    please please plssssssss help me really want to get this to work
    thanks and regards

    OK I apologise and realise I was in a rush. I will try explain more clearly now.
    I am using Netbeans 7 and am having troubles connecting my java program to a Microsoft Access database which is on this website:
    sites.google.com/site/card3al3rsh1p/
    The database name is "CarDealership.accdb".
    When I use the class below to connect to my database locally, it is a success.
    import java.sql.*;
    public class DB {
    Connection con;
    Statement stm;
    ResultSet rs;
    public DB(){
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=*CarDealership.accdb*");
    } catch(Exception ex){
    System.out.println("Error opening database.");
    System.out.println(ex);
    System.out.println("Database successfully opened.");
    However, when I change the bold text above (or the text between the asterisks, not sure if it will change) to "sites.google.com//site//card3al3rsh1p//CarDealership.accdb" it throws an error signifying that it can't find the file specified.
    I am unsure of how to connect my program to an external file so I need assistance in how to change the url String of the DriverManager.getConnection() method above so it can connect to the database on the website mentioned above. I would appreciate it if you could assist and thanks.

  • Connecting to a database on another machine, please help!!!!!!

    Hi there,
    I am new to oracle and at the minute I am using Oracle 9i. I have set up a database on one machine (PC2) and would like to create an odbc from another machine (PC1) to connect to this database. I have set up a listener for (PC1) the using oracle net manager on PC2. what I want to know is: is there anything else I need to do on the PC2 end???? Also, what needs to be done on the PC1 end??? please help!!!

    If everything is setup and working properly on the Server PC2, you can just test the ODBC from PC1 (assum you already have an Oracle ODBC drive).

  • Help with connection to mysql database, Getting error : No suitable Driver

    Below is my code :
    1) i have added the mysql driver (mm.mysql-2.0.14-bin.jar)in my classpath
    2) the code is getting compiling properly
    3) while running it using tomcat, it says "NO SUITABLE DRIVER"
    PLEASE HELP !!
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class logincheck extends HttpServlet {
    public void doGet(HttpServletRequest request,HttpServletResponse response)
    throws IOException, ServletException
    Connection con = null;
    PrintWriter out = response.getWriter();
    response.setContentType("text/html");
    PreparedStatement stmt = null;
    ResultSet rs = null;
    String userid = request.getParameter("userid");
    String password = request.getParameter("password");
    try {
    /** LOADING THE DRIVER FOR MYSQL DATABASE ***/
    Class.forName ("org.gjt.mm.mysql.Driver";
    } catch (ClassNotFoundException e) {
    e.printStackTrace();
    } //End of try-catch 1
    try{
         /*** CONNECTING TO THE DATABASE USING DATABASE NAME, USERNAME AND PASSWORD */
    con = DriverManager.getConnection("jdbc:mysql://localhost:8080/own");
    /****** this checks whether the entry for the user is in the database *****/
    stmt = con.prepareStatement("SELECT *FROM userinfo WHERE userid = ? AND passwd = ?");
    stmt.setString(1,userid);
    stmt.setString(2,password);
    rs = stmt.executeQuery();
    if(!rs.next())
    else
         /****************** IF THE USER AND PASSWORD ARE VALID *****************/
    //} // END OF RS.....
    // NEED HTML FOR INVALID USERID SHOWING MESSAGE ...
    con.close();
    }catch(SQLException esql){
    System.out.println(esql.getMessage());
    } // End of try-catch 2
    } // goGet
    public void doPost(HttpServletRequest request,HttpServletResponse response)
    throws IOException, ServletException {
    doGet(request, response);
    } // goPost
    } // end logincheck function ...

    And i see another thing that confuses me. Your URL connection string is
    con = DriverManager.getConnection("jdbc:mysql://localhost:8080/own"); meaning that your database is in your machine and listens in port 8080 for incoming connections. But that is the default port that Tomcat listens! Maybe you should change this line to
    con = DriverManager.getConnection("jdbc:mysql://localhost:3306/own");where 3306 is MySQL's default port.
    Hope these help.

  • Help needed to start a basic connection to a database

    Hi,
    totally new in this java JDBC concept. Need help to perform a kick start ni a program which will connects to a database and perform a simply SQL query.
    Possible can demostrate a full simple program that connects to the database and perform the SQL query.
    PS : database not accessed through webserver, but through direct connection.
    Thanks

    http://java.sun.com/docs/books/tutorial/jdbc/index.html

  • I was facing problem while connecting to oracle database.Can some one help me soon!!!!!

    Hi all,
    I was facing problem from last week.Suddenly i was getting ora-12505 error while connecting to the database through toad.I tried to change tnsnames.ora & listener.ora in multiple ways,but no luck...Inspite i was getting different errors like ora - 01034: ORACLE not available / ora - 27101: shared memory realm does not exist...When i try to connect using sys / sys as sysdba,connection is establishing and when issue the command startup it was throwing the error ORA-01821: date format not recognized......Fed up solving these issues....Can some one help me out...It's very very urgent..
    Thanks in advance,
    pavankumar.

    Well, the obviously solution is to use separate Apple ID's for iCloud.

  • Help using C# application to connect to oracle database

    I'm new to database.
    I'm developing a C# GUI application in visual studio 2008 that is suppose to interact with oracle. After researching and trying out several sample codes, nothing works and I'm in desperate need of some help/advice/suggestions.
    The simplest example I'm trying is to just get a button to run a simple SQL query. The code is:
    private void button1_Click(object sender, EventArgs e)
    string oradb = "Data Source=acme.gatech.edu;User Id=gtg880f;Password=******;";
    OracleConnection conn = new OracleConnection(oradb); // C#
    conn.Open();
    OracleCommand cmd = new OracleCommand();
    cmd.Connection = conn;
    cmd.CommandText = "select Location_Name from warehouse where Location_name = 'atlanta'";
    cmd.CommandType = CommandType.Text;
    OracleDataReader dr = cmd.ExecuteReader();
    dr.Read();
    label1.Text = dr.GetString(0);
    conn.Dispose();
    I've installed many many version of oracle database and have included the Oracle.Data.Access under reference.
    If I use putty and connect to acme.gatech.edu via port 22, I can type sqlplus / and run the query "elect Location_Name from warehouse where Location_name = 'atlanta'" and it'll work.
    After some research, some say that if I can connect via sqlplus that means i can connect to the database but what do i need to implement to enable my c# code in visual studio to be able to do that.
    I did a search on the forum but found nothing that matches this. In essence, I'm not sure what/how to specify such that I can connect to the acme.gatech.edu server and run sql commands.
    Thanks,
    Oky Sabeni

    There're two ways you can get data in and out of database using .NET
    #1 System.Data.OracleClient namespace - it's .NET avail out of the box
    #2 Oracle.DataAccess.Client - aka "ODP.NET"
                   Download: http://www.oracle.com/technology/software/tech/windows/odpnet/index.html
    Or download Beta because as of today it's the only version which supports .NET "TransactionScope" (I just tested seems like still it is NOT working Re: 10g Express + ODP.NET (version 2.111.6.20) > support TransactionScope? http://www.oracle.com/technology/software/tech/windows/odpnet/index1110710beta.html
    QuickStart: http://www.installationwiki.org/ODP.NET_Getting_Started_Guide
    Also there's a doc under Start menu>Programs>Oracle - OraOdac11g_BETA_home>Application Development>"Oracle Data Provider for .NET Developer's Guide"
    It's worth reading just scroll down quick for code fragment.
    Anyway here's two small examples:
    Example 1: System.Data.OracleClient (Using library from M$)
              * First you'll need to add reference to "System.Data.OracleClient".
              IDbFactory oDbFactory = DbProviderFactories.GetFactory("System.Data.OracleClient");
              IDbConnection oConn = oDbFactory.CreateConnection();
              oConn.ConnectionString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;";
              // Or ...
              oConn = new System.Data.OracleClient.OracleConnection("Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;");
         Example 2: ODP.NET from Oracle
              IDbFactory oDbFactory = DbProviderFactories.GetFactory("Oracle.DataAccess.Client");
              IDbConnection oConn = oDbFactory.CreateConnection();
              oConn.ConnectionString = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;";
              // Or ...
              oConn = new Oracle.DataAccess.Client.OracleConnection("Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;");
    string strSQL = "... SQL statement...";
              int nPersonId = 0;
              string strFirstName = null;
              Person oPerson = null;
              string strSQL = "SELECT Id FROM PERSON";
              oCmd = oConn.CreateCommand();
              oCmd.CommandText = strSQL;
              oCmd.CommandType = System.Data.CommandType.Text;
              IDataReader oRdr = oCmd.ExecuteReader();
              while (oRdr.Read())
                   if (!Convert.IsDBNull(oRdr["Id"]))
                        nPersonId = (int) oRdr["Id"];
                   if (!Convert.IsDBNull(oRdr["FirstName"]))
                        strFirstName = (string)oRdr["FirstName"];
                   oPerson.Id = nPersonId;
                   oPerson.FirstName = strFirstName;
    Example CREATE TABLE:
              DECLARE
              count_item int;
              BEGIN
                   SELECT count(1) into count_item FROM user_sequences WHERE sequence_name = 'AUDITLOGSEQUENCE';
                   IF count_item > 0 THEN
                        begin
                        dbms_output.put_line('drop sequence AUDITLOGSEQUENCE');
                        EXECUTE IMMEDIATE ('DROP SEQUENCE AUDITLOGSEQUENCE');
                        end;
                   ELSE
                        dbms_output.put_line('no need to drop AUDITLOGSEQUENCE');
                   END IF;
                   EXECUTE IMMEDIATE 'CREATE SEQUENCE AUDITLOGSEQUENCE
                        MINVALUE 1
                        MAXVALUE 999999999999999999999999999
                        START WITH 1
                        INCREMENT BY 1
                        CACHE 20';
                   dbms_output.put_line('AUDITLOGSEQUENCE created');
                   SELECT count(1) into count_item FROM user_tables WHERE table_name = 'LOG';
                   IF count_item > 0 THEN
                        begin
                        dbms_output.put_line('drop table LOG');
                        EXECUTE IMMEDIATE ('DROP TABLE LOG');
                        end;
                   ELSE
                        dbms_output.put_line('no need to drop table LOG');
                   END IF;
                   EXECUTE IMMEDIATE '
                        CREATE TABLE LOG (
                             Id numeric(19,0) NOT NULL,
                             CreateDate timestamp default sysdate NOT NULL,
                             Thread varchar (510) NULL,
                             LogLevel varchar (100) NULL,
                             Logger varchar (510) NULL,
                             Message varchar (4000) NULL,
                             InnerException varchar (4000) NULL,
                             CONSTRAINT PK_LOG PRIMARY KEY (Id)
                   COMMIT;
                   dbms_output.put_line('table LOG created');
                   dbms_output.put_line('setup complete');
              EXCEPTION
                   WHEN OTHERS THEN
                        dbms_output.put_line('*** setup exception detected! ***');
                        dbms_output.put_line('error code: ' || sqlcode);
                        dbms_output.put_line('stack trace: ' || dbms_utility.format_error_backtrace);
                        RAISE_APPLICATION_ERROR(-20000, 'AuditTrail.oracle.tables.sql - install failed');
              END;
         Before running script, make sure your account has permission (unless you're using SYS account of course). You'd probably need to know how to create user and granther right:
              CREATE USER dev IDENTIFIED BY "devacc_@";
              GRANT CREATE SESSION TO DEV;
              GRANT DBA TO DEV;
         Here's how you can run PL\SQL scripts in Oracle
         SQL*Plus: Release 10.2.0.1.0 - Production on Mon Apr 6 14:10:05 2009
              Copyright (c) 1982, 2005, Oracle. All rights reserved.
              SQL> connect devvvy/"somepwd"
              Connected.
              SQL> set serveroutput on
              SQL> @C:\dev\UnitTest\Util\Command\sql\Oracle\SetupSchema\xxxxx.oracle.tables.sql
              1125 /
              SQL> @C:\dev\Util\Command\sql\Oracle\SetupSchema\xxxxx.oracle.tables.data.only.sql
              560 /
              PL/SQL procedure successfully completed.
              SQL> @C:\dev\Util\Command\sql\Oracle\SetupSchema\AuditTrail.oracle.tables.sql
              54 /
              PL/SQL procedure successfully completed.
              SQL> COMMIT;
         Remeber however:
              (a) SQL*Plus does not like "&" in your SQL script. Do comment or string containing "&" should be taken out.
              (b) password should not contain "@" because it's a special character in "CONNECT" command.
                   Alternative, download TOAD for Oracle - http://www.toadsoft.com/toad_oracle.htm
              (c) After command, type "/" next line to get command executed.
              (d) remember to COMMIT
    REF for Oracle:
         Oracle Official doc: http://www.oracle.com/pls/db111/portal.portal_db?selected=1&frame=
         Oracle 11g configuration Guide: http://www.thegeekstuff.com/2008/10/oracle-11g-step-by-step-installation-guide-with-screenshots/
         ODAC/ODP.NET QuickStart: http://www.installationwiki.org/ODP.NET_Getting_Started_Guide
         ODP.NET versioning scheme: http://download.oracle.com/docs/html/E10927_01/InstallVersioningScheme.htm
         SQLPlus basic: http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25108/xedev_sqlplus.htm#CJAGGHGE
         PL\SQL:
              Cheat sheet: http://en.wikibooks.org/wiki/Oracle_Programming/SQL_Cheatsheet
              Reference:
                   http://www.rocket99.com/techref/oracle_plsql.html
                   http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm
              EXECUTE IMMEDIATE, DROP/CREATE TABLE: http://www.java2s.com/Code/Oracle/PL-SQL/Callexecuteimmediatetodroptablecreatetableandinsertdata.htm
              Exception handling: http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/07_errs.htm
              Named Block syntax: http://www.java2s.com/Tutorial/Oracle/0440__PL-SQL-Statements/Thestructureofanamedblock.htm
              CREATE PROCEDURE: http://it.toolbox.com/blogs/oracle-guide/learn-plsql-procedures-and-functions-13030
         Oracle DataType: http://www.ss64.com/orasyntax/datatypes.html
                             http://www.adp-gmbh.ch/ora/misc/datatypes/index.html
         Oracle Sequence and Create table: http://www.java2s.com/Tutorial/Oracle/0100__Sequences/Usingasequencetopopulateatablescolumn.htm

  • Help Connecting A Stateless Session Bean To MySQL Database

    Hi, I'm trying to connect a simple stateless session bean that has been
    deployed using the admin console to a MySQL database that has been
    set up and pinged using the JDBC Resources/Connection Pools part of the
    admin console.
    When I attempt to connect to the database using the session bean I get the
    following error message:
    Exception in thread "main" java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.RemoteException: ; nested exception is:
         java.sql.SQLException: No database selected
         at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:161)
         at javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:142)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at DBDynamicStub.testDatabase(_DB_DynamicStub.java)
         at DBClient.main(DBClient.java:9)
    Caused by: java.rmi.RemoteException: ; nested exception is:
         java.sql.SQLException: No database selected
         at com.sun.ejb.containers.InvocationHandlerUtil.throwRemoteException(InvocationHandlerUtil.java:96)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:141)
         at $Proxy26.testDatabase(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:123)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:648)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1709)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1569)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:951)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:721)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:469)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1258)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:409)
    Caused by: java.sql.SQLException: No database selected
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2851)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:2379)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:2306)
         at com.mysql.jdbc.Statement.executeQuery(Statement.java:1192)
         at DBBean.testDatabase(DBBean.java:45)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:950)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:158)
    Obviously this means that the bean can't connect to the database but I am
    unsure why this is. When I set up the database using the admin console
    I set the the jndi name to jdbc/test and I've tried using the following look up
    code to find the database that is referenced by the JNDI name:
    Context context = new javax.naming.InitialContext();
              DataSource ds = (DataSource) context.lookup("jdbc/test");
    and also
    Context context = new javax.naming.InitialContext();
    DataSource ds = (DataSource)context.lookup("java:comp/env/jdbc/test");
    Neither of these methods work.
    When I look at the JNDI Tree Browsing window which is available from the
    admin console there is no mention of the database at all, there are four
    items in the three, they are:
    UserTransaction
    ->jdbc
    ->ejb
    DBBean
    Do I need to add a JNDI reference somewhere in order for the bean to locate
    the database? I thought that when I created the database in the admin
    console and specified a JNDI name this would be all that's required in order
    for beans to locate the database, obviously not.
    If anyone can offer any advice at all I would be very very grateful.
    Ian

    stmt.execute("use YOUR_DATABASE_NAME");
    // then your db queries.This approach works for me.
    It also works to specify the database in the query like this:
    InitialContext initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    DataSource ds = (DataSource) envCtx.lookup("jdbc/myDB");
    Connection conn = ds.getConnection();
    try {
           Statement statement  = conn.createStatement();
           ResultSet rs = statement.executeQuery("select * from myDB.news");
           ...As you can see I added myDB. to the query.
    But why is this necessary?
    If I use DriverManager instead, this is NOT necessary. Like this:
    Connection connection = null;
    try {
           Class.forName("com.mysql.jdbc.Driver");
           connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/myDB", "username", "password");
           Statement statement = connection.createStatement();
           ResultSet rs = statement.executeQuery("select * from news");
           ...Why do I not have to run the query statement.execute("use YOUR_DATABASE_NAME"); or specify the database name in the query statement.executeQuery("select * from myDB.news"); when I use DriverManager to obtain a Connection when I have to do that when using a DataSource?
    It don't seem very efficient to have to run the extra query ( use db-name ) before I run any other query in my application.

  • Pls help - cant connect to my database while my class is part of a package

    Can anyone please tell me why one can't connect to a database, while the class is part of a package?
    package Application;
    import java.sql.*;
    public class GameDatabase
    GameDatabase ()
    connect ();
    public void connect ()
    try
    String url = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=Profiles.mdb";
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection dbcon = DriverManager.getConnection (url);
    catch (ClassNotFoundException a)
    System.out.println ("ClassNotFoundEx");
    catch (SQLException e)
    System.out.println ("SQLEx");
    public static void main (String [] args)
    new GameDatabase ();
    gives a SQLexception while the "package Appplication;" is present,
    yet works perfectly when its commented.
    Any suggestions how to bypass this?

    Well, it just cannot find the file? Maybe you've to supply a path?
    Further on, one more lesson:
    System.out.println ("ClassNotFoundEx");
    System.out.println ("SQLEx");Please don't ignore exceptions. They are not intented for phun. Rather use e.printStackTrace();

  • SQL SEREVR CONNECTION TO LOCAL DATABASE FAILED ,help!!

    Hai,
           I detached my dev database from sql server 2000 enterprise manager and then i replaced my old data files mdf,ndf and ldf with the new once on the same location. now when i start sql server it is not showing any of databases , i also registered the sql server again and it gives me mesage can't connect to database login failed.
       i think there must be some password at db level which is causing problem.
    if i have to change the old password at this stage what should i do??
    hope i find some solution
    regards
    jase

    Hi,
    you must logon with another user. Use a local admin. Logon on Windows with another local admin and connect to your SQl Server. Once you are connected attach the database again. Then you are able to connect via sidadm again.
    The root cause is, that the default database of the sidadm is detached, so the sidadm cannot log on.
    A second way can be to use the osql.exe tool. Open a command promt and run
    osql -E -dmaster
    This should you connect to the default instance of the server and switch to the master database, Then you can run
    exec sp_defaultdb '<sid>adm','master'
    go
    Then you should be able to logon as sidadm as well.
    regards
      Clas

Maybe you are looking for

  • 4.7 Enterprise install error in catproc.sql phase(RedHat5- Oracle 10.2.0.4)

    Hi, I am installing SAP 4.7 Enterprise on Red Hat 5.3 and Oracle 10.2.0.4. When I install 4.7 Enterpirse I have an error in catproc.sql phase like below: - ERROR 2009-06-02 18:42:34 CJS-00084  SQL statement or script failed.<br>DIAGNOSIS: Error messa

  • Oracle Hint not causing any change to explain plan

    Hi, I was facing a problem about ORA-00600 for using Connect by Prior query, details of which are at - Connect by Prior - ORA-00600: internal error code, arguments: [kkqcbydrv:1 As is documented by Oracle, workaround for this is to use /*+ NO_UNNEST

  • Authorizations for transactions MIR6/MIR4

    Hi All, Need help to setup a security rights for transactions MIR6/MIR4. Here is the situation: We have setup an user profiles which allow the users to access transaction mir6 (provide a list of Invoide Documents(BELNR)which will lead into transactio

  • SAP Logging

    Hello, I am trying to use SAP Logging in my J2EE Web Application. When I tried adding the line of code "import com.sap.tc.logging.*;" the compiler complained as it's not found. Then I tried adding by "set additional libraries" and found "com.sap.tc.L

  • How do I chat with Iphone users?

    Can I use I chat to chat with my friends that have Iphones using Ichat or do I need to download Facetime which is what most Iphone users use?