Java, access database( mdb) and java.sql.date

I having a problem querying my access database with user specified date the code is as follows
//get results of income from database with respectto dates
     //so u first create the sql.date instances
     private void getResults(){
     String text1=from.getText();//text input is like this 01-01-2005
          String text2=to.getText();
     Date d1=new Date(Integer.parseInt(text1.substring(6)),Integer.parseInt(text1.substring(3,5)),Integer.parseInt(text1.substring(0,2)));
     JOptionPane.showMessageDialog(this,d1.toString());//traces date with 1900 added to year and 1 added to month
     try{
          //custom class DataSource used to connect to database
          Connection conn=DataSource.getConnection("RealFotoInc");
          PreparedStatement ps=conn.prepareStatement("select * from Members where date=?");
          ps.setDate(1,d1);
          ResultSet rs=ps.executeQuery();
          while(rs.next()){
               System.out.println("going");
               System.out.println("trial"+rs.getString(3));
     }catch(Exception se){
          JOptionPane.showMessageDialog(this,se);
     }and it prints out nothing I dont know what is wrong

Whoever put that comment in there about "1900" and so on knew what had to be done. That "Date" class must be "java.sql.Date"; go and read the API documentation of that constructor you are using there. Then adjust the parameters you are passing to it accordingly.

Similar Messages

  • Column Not found error while trying to access database through JSP+Java Bea

    I am trying to access MS Access 2003 db through JSP using Tomcat 5.0.28.The code for accessing the database is incorporated in the bean.The JSP only calls the particular method of the bean .
    Code for Java Bean:
    package ActiveViewer;
    import java.sql.*;
    import java.util.*;
    public class CompanyBean
    Connection con;
    ResultSet rs=null;
    Statement st;
    public CompanyBean(){}
    public void connect()
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Here4");
    con=DriverManager.getConnection("jdbc:odbc:activeviewer","","");
    System.out.println("Here1");
    catch (ClassNotFoundException e)
    System.out.println("Could not locate driver.");
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
    e.printStackTrace();
    catch (Exception e)
    System.out.println("An unknown Exception has occured :: "+e);
    e.printStackTrace();
    public void disconnect()
    try
    if (con!=null)
    con.close();
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
    e.printStackTrace();
    public ResultSet select(String username)
    if(con!=null)
    try
    st=con.createStatement();
    rs=st.executeQuery("select * from company where username='" + username + "'");
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
    e.printStackTrace();
    catch (Exception e)
    System.out.println("An Exception has occured while retrieving :: "+e);
    e.printStackTrace();
    else
    System.out.println("Connection to database was lost.");
    return rs;
    The code for JSP that uses the above bean is:
    <%@ page language="java" import="java.sql.*,ActiveViewer.* " contentType="text/html"%>
    <jsp:useBean id="conn" scope="session" class="ActiveViewer.CompanyBean" />
    <html>
    <body>
    <% String username=request.getParameter("username");
    String password=request.getParameter("password");
    System.out.println("username:"+username);
    System.out.println("password:"+password);
    conn.connect();
    ResultSet rs=conn.select(username);
    System.out.println("Below select ");
    while (rs.next())
    String dbusername=rs.getString("username");
    String dbpassword=rs.getString("password");
    if(dbusername.equals(username) && dbpassword.equals (password))
    { %> out.println("OK");
    <% }
    else { %>Invalid Username and / or Password.
    <br>Clickhere to go back to Login Page.
    <% }
    } %>
    </body>
    </html>
    I get the following error:
    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: Column not found
    though the database is not int he same folder as the jsp, the DSN is set correctly to pint to the db location.The jsp does print in stdout file:
    Here4 (from connect method above)
    Here 1 (from connect method above)
    Below Select (from jsp)
    This means that the jsp does connect to db but it gives the above error.Also the field name also matches that in the database and data is present in the db too.
    All other things like creating package for bean in WEB-INF/classes,incorporating the packakage are done.
    Can someone please help me with their precious advice?

    Hi, I too have a problem with an SQL exception, the message is Column not found.
    I'm using the sun jdbc odbc driver with access.
    the first few lines of the stack trace are
    sun.jdbc.odbc.JdbcOdbcResultSet.findColumn(JdbcOdbcResultSet.java:1852)
    sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcResultSet.java:603)
    net.homeip.sdaniels.MemberBean.ejbFindByUnamePwd(MemberBean.java:127)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    I am of course sure that the column does infact exist. I can insert into the column no problems. the sql looks like this:
    SELECT * FROM Members WHERE uName ='Stewart' AND encPwd='�F2C�3����h�1Y�'
    Can any one tell me if there is a common cause to this problem?
    Thanks

  • Problem in accessing database using a java class

    Hy Folks,
    I have written a class to retrive data from data base and compiled it.when I said java QueryExample, I am getting the following error message.It is as below.
    E:\>java QueryExample
    Loading JDBC Driver -> oracle.jdbc.driver.OracleDriver
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:120)
    at QueryExample.<init>(QueryExample.java:37)
    at QueryExample.main(QueryExample.java:129)
    Creating Statement...
    Exception in thread "main" java.lang.NullPointerException
    at QueryExample.performQuery(QueryExample.java:70)
    at QueryExample.main(QueryExample.java:130)
    Now my question is can I run a jdbc program with out using any application server or webserver.
    If I can , what are all the packeages I have to down load, and how to set their classpath.
    Regards,
    Olive.

    My basic doubght is can we write a class like this.Here I give the sample code that I am using,,,, and using Oracle9i for Windows release 2 (9.2) .
    // QueryExample.java
    import java.sql.DriverManager;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    * The following class provides an example of using JDBC to perform a simple
    * query from an Oracle database.
    public class QueryExample {
    final static String driverClass = "oracle.jdbc.driver.OracleDriver";
    final static String connectionURL = "jdbc:oracle:thin:@localhost:1521:O920NT";
    final static String userID = "scott";
    final static String userPassword = "tiger";
    Connection con = null;
    * Construct a QueryExample object. This constructor will create an Oracle
    * database connection.
    public QueryExample() {
    try {
    System.out.print(" Loading JDBC Driver -> " + driverClass + "\n");
    Class.forName(driverClass).newInstance();
    System.out.print(" Connecting to -> " + connectionURL + "\n");
    this.con = DriverManager.getConnection(connectionURL, userID, userPassword);
    System.out.print(" Connected as -> " + userID + "\n");
    } catch (ClassNotFoundException e) {
    e.printStackTrace();
    } catch (InstantiationException e) {
    e.printStackTrace();
    } catch (IllegalAccessException e) {
    e.printStackTrace();
    } catch (SQLException e) {
    e.printStackTrace();
    * Method to perform a simply query from the "emp" table.
    public void performQuery() {
    Statement stmt = null;
    ResultSet rset = null;
    String queryString = "SELECT name, date_of_hire, monthly_salary " +
    "FROM emp " +
    "ORDER BY name";
    try {
    System.out.print(" Creating Statement...\n");
    stmt = con.createStatement ();
    System.out.print(" Opening ResultsSet...\n");
    rset = stmt.executeQuery(queryString);
    int counter = 0;
    while (rset.next()) {
    System.out.println();
    System.out.println(" Row [" + ++counter + "]");
    System.out.println(" ---------------------");
    System.out.println(" Name -> " + rset.getString(1));
    System.out.println(" Date of Hire -> " + rset.getString(2));
    System.out.println(" Monthly Salary -> " + rset.getFloat(3));
    System.out.println();
    System.out.print(" Closing ResultSet...\n");
    rset.close();
    System.out.print(" Closing Statement...\n");
    stmt.close();
    } catch (SQLException e) {
    e.printStackTrace();
    * Close down Oracle connection.
    public void closeConnection() {
    try {
    System.out.print(" Closing Connection...\n");
    con.close();
    } catch (SQLException e) {
    e.printStackTrace();
    * Sole entry point to the class and application.
    * @param args Array of String arguments.
    * @exception java.lang.InterruptedException
    * Thrown from the Thread class.
    public static void main(String[] args)
    throws java.lang.InterruptedException {
    QueryExample qe = new QueryExample();
    qe.performQuery();
    qe.closeConnection();
    }

  • Access Database (.mdb) on Windows Server 2012 R2 Essentials

    Hi guys, thanks for your time!
    SCENARIO:
    - Windows Server 2012 R2 Essentials
    - Windows 7 Ultimate Clients (3 clients)
    - VB6 application on clients using a MS Database (.mdb) hosted on the server.  
    - Clients access the database (.mdb) via a mapped network drive (K:).
    PROBLEM:
    - Microsoft Database (.mdb) on server gets corrupted frequently.
    - Clients don't "flush their changes" back to the database: database was not updated.
    WORKAROUND:
    - Database was moved from the server to one of the Windows 7 clients.
    - Application is running OK.
    CONFIGURATION:
    - Permissions are correct: network and NTFS.
    - No faulty network hardware: switch, cabling, NICs.
    - Computers and Server hardware is new.
    - UPS are used everywhere.
    SOME LINKS:
    SMB 3.0 
    - Opportunistic Locking and Read Caching on Microsoft Windows Networks.
    - Windows 7 cannot
    open the shared MS Access database if it's opened by another user
    - Initializing the
    Microsoft Jet 4.0 Database Engine Driver
    - Moved to
    Server 2012 getting Access Database Corruption
    Oplocks
    - Configuring
    opportunistic locking in Windows
    - Understanding
    offline files
    - How to
    enable and disable SMBv1, SMBv2, and SMBv3
    - Is it possible to
    monitor and log actual queries against an Access MDB?
    Now, server is useless if it is not hosting our database. Any ideas, please? Do I need to diagnose using Wireshark? Or using Sysinternals Process Monitor? I think that is a waste of time. 
    Thank you! 

    Thanks for your reply.
    Software is from a 3rd party provider. It currently supports concurrency. It was deployed on Windows XP. SQL Server would be a nice upgrade, however that is
    not an option.
    Something has changed with newer versions of Windows. That is what I am going to study in a lab I prepared with a real server and some clients.
    File-sharing databases (Microsoft JET databases) are very old technology even before I was a college student. However, I have been very busy researching this technology.
    It was made for multi-user environments. It is highly tied to file sharing services from Windows: SMB protocol.
    Windows XP, Vista, 7 and 8 use different versions of this protocol. I think that is the root of the problem. With old technology, application was running fine.
    With new technology, application is troublesome. I will check several things: JET drivers vs. ACE drivers, SMB tweaks, etc.
    UPDATE:
    Basically, there are 4 general answers to this issue:
    1) Migrate your Access Database to SQL Server Express (or another RDBMS engine).
    2) @Server: disable SMB 2.0/3.0 protocol stack by powershell command. Network speed decreases.
    3) @Clients: disable client redirector caches by using regedit.
    4) @Server: disable the leasing on the file server. 
    5) @Server: tuning Broadcom NIC parameters.
    References:
    - https://technet.microsoft.com/en-us/library/ff686200(WS.10).aspx
    - https://msdn.microsoft.com/en-us/library/windows/desktop/aa365433(v=vs.85).aspx
    - http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/Q_28482197.html
    - http://tipsntricks.sherr.co.uk/stop-smb-corrupting-files/
    - http://www.dataaccess.com/whitepapers/opportunlockingreadcaching.html
    - https://social.technet.microsoft.com/forums/windowsserver/en-US/67baa9fd-5eaf-438e-9cc4-dc1a531b9e19/disabling-oplocksmb2-vs-fileinfocachelifetime
    - https://social.technet.microsoft.com/Forums/windowsserver/en-US/7336d31b-6c24-468a-9c47-750244ae3a8c/moved-to-server-2012-getting-access-database-corruption
    - https://social.technet.microsoft.com/Forums/en-US/e9567167-22db-4b8c-9f96-a08b97d507f9/server-2012-r2-file-server-stops-responding-to-smb-connections
    - http://support2.microsoft.com/kb/2957623
    - http://support2.microsoft.com/kb/2899011
    - http://support2.microsoft.com/kb/2955164
    - https://social.technet.microsoft.com/Forums/en-US/7bd0aa5b-eb95-40a8-a56d-c6013273665c/extremely-slow-smb-network-speed-server-2012-r2?forum=winserver8gen

  • Using LV 8.6 to access database created in MS SQL Server Management Studio

    I am using Labview 8.6 to access a database created in MS SQL Server Mgmt Studio, using LabSQL ADO utilities. I don't have LV's add-on DB connectivity toolkit, but just the ADO utilities. Can i do it? If yes, how? I have no experience whatsoever in connecting and accessing data from a DB. An example would help.
    Thanks,

    Szi wrote:
    As for my opinion you cant access without DB connectivity toolkit.
    Nonsense.
    With LabSQL, you should first find an on-line SQL tutorial and refer to the Microsoft help files. I would recomend creating a UDL file. This is the connection string you use for the ADO Connection Open function. You might want to to get a little help from the db administrator. You'll certainly need help in getting a login and password.
    There are examples that come with LabSQL

  • Restoring an ms access database backup file in sql server 2005

    Hello everyone.
    I have an ms access database backup file.
    Presently i dont have ms access database in  my system.
    It is high priority to access that ms access database backup file. 
    So, is there anyway to access that in sql server?
    -- Thanks and Regards Srikar Reddy Gondesi, Trainee SQL Server Database Administrator Miracle Software systems, Inc.

    Hello sir,
    i tried to use import/export wizard to import data from an ms access backup file.
    I completed it with some warning's.
    Wizard has shown that 2 out of three objects(tables and views) are copied to destination database(empty database which i have created for storing this imported data).
    And in that process, wizard made me to create a package.
    Now how to access that package?
    And my newly created database has no data.(i mean it is supposed to have 2 objects which are copied from source right?)
    Sorry if my doubt looks silly i have never used ssis or import/export ever before.
    -- Thanks and Regards Srikar Reddy Gondesi, Trainee SQL Server Database Administrator Miracle Software systems, Inc.
    -- Thanks and Regards Srikar Reddy Gondesi, Trainee SQL Server Database Administrator Miracle Software systems, Inc.

  • Create a Access Database file and Dsn dynamically

    hi,
    in my program i have to dynamically create an Acess database (*.mdb) file. i would like to know if it is possible to do so and also if yes then also how to dynamically create a dsn to that dbase.

    hi,
    in my program i have to dynamically create an Acess
    s database (*.mdb) file. It might be possible via OLE/ADO. But that means JNI if you are using standard java.
    A common way around this is to deliver a 'blank' database with the application and just copy it whenever a new database is needed.
    i would like to know if it is
    possible to do so and also if yes then also how to
    dynamically create a dsn to that dbase.Creating a DSN again requires JNI or special tools to manipulate the registry.
    A common way around that is to use a DSN-less connection, so you don't have to create one. If you search this forum you will find examples of the connection string for that.

  • Query 32 bit Access Database from 64 bit Sql Server

    Hi All,
    I have a task to query the Accessdb from Sql Server and below are the configuration details:
    OS: Windows Server 2008 R2 Enterprise( 64 bit)
    Sql Server: Sql Server 2012 enterprise (64 Bit)
    Access : MS Office 2010 (32 bit)
    I used the below queries to reap the data from access db.
    SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','D:\Product.accdb', Product) AS Product
    (or)
    SELECT * FROM OPENROWSET('MICROSOFT.ACE.OLEDB.12.0','D:\PRODUCT.ACCDB', PRODUCT) AS PRODUCT
    following error returnd from both queries.
    Error: "Msg 7438, Level 16, State 1, Line 2.    The
    32-bit OLE DB provider "Microsoft.Jet.OLEDB.4.0" cannot be loaded in-process on a 64-bit SQL Server."
    Please help.
    Ram MSBI Developer

    not sure if anyone is watching this thread anymore but i have this scenario. i am using the excel connection manager in SSIS to create an excel spreadsheet with VS 2012.  To do this from what I have read I am required to use the 32-bit driver for "Microsoft
    Access database engine 2007", if I use the 64-bit driver I cannot connect to the Excel connection manager.   i get 0xc020801c message.
    i can install the 32-bit "Microsoft Access database engine 2007" and resolve this problem.  but i also have a stored procedure that creates a spreadsheet (i use this because i have to leave some cells intact), it appears to require the
    64-bit "Microsoft Access database engine 2007".  in 32-bit mode i get the following message
    Msg 7438, Level 16, State 1, Procedure sp_CreateGRfile, Line 26
    The 32-bit OLE DB provider "Microsoft.ACE.OLEDB.12.0" cannot be loaded in-process on a 64-bit SQL Server.
    so i need both the 32-bit  "Microsoft Access database engine 2007" and 64-bit  "Microsoft Access database engine 2007".
    any thoughts on getting around this issue?

  • My database not listed at SQL data source in Web Expression 4

    Can anyone help me out?
    Am not sure whether this is the correct place for my problem.
    I set up SQL Server 2005. Created a database named "employee" and a table under it "emp_info"
    I tried to connect it from Microsoft Web Expression 4 through SQL Data Source control. Well, the connection test is successful but the database i created is not shown in the drop down. However, it shows the system databases. 
    Again i create the table under one of the system databases, and tried to connect it. Those system tables which are there from before are only available to connect but not the table i newly created.
    I have checked the properties, permission of the table as well as the database. Nothing is wrong there.
    Will attach screenshot after the forum admin verify me.

    Hi Marconi,
    The forum supports VS setup and installation. Your issue is more about Web Expression 4. But I find the information below from the link:http://www.microsoft.com/expression/eng/#web
    The web is now about applications as well as traditional web sites, and this requires a new set of tools. Microsoft is committed to offering a unified approach to focus on web design and development features in Microsoft Visual Studio 2013 and beyond.
    As part of this consolidation, Microsoft Visual Studio 2013 provides the leading web development tool, which enables you to design, develop, and maintain websites and web applications. Visual Studio 2013 makes it easy to build CSS-based websites from the
    ground up with CSS layouts, HTML5 support and full featured capabilities for working with and debugging JavaScript. Learn more about
    Visual Studio Express 2013 for Web and
    WebMatrix 3.
    It seems you could install VS express 2013 for web to instead it. If you want to install VS express for web and you encounter any issue, you could post the installation issue to here.
    >>No, this is not the correct forum. This forum is for using .Net Framework inside SQL Server.
    The sentense is from the first reply. It seems you first post the issue to SQL server for help. As Erland said, it seems your issue is more about Web Expression 4. Have you solved your issue by using the first reply? If has, please mark the first reply as
    answer. If not, you could post your issue to the related forum for better support.
    http://social.msdn.microsoft.com/Forums/expression/en-US/home?forum=web
    I will move the thread to off-topic forum. Thanks for your understanding.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • What's the difference between using java directly in JSP and java bean

    What is the difference if I use java code directly in JSP or use java bean in JSP?
    Which class to use for receiving the passed parameter from html or java script? Any difference for java code and java bean in the way receiving the passed data?
    How can I pass string from jsp to html or java script?

    1 Cleaner pages
    2 you have to write the class and use set and get methods
    3 What do you mean when saying passing string from jsp to html??, do you mean the value you can use <%=variablename%>

  • Difference between Java 1.4.2 and Java 1.2.2

    Can someone please specify the main updates covered on the Java 1.4.2 that Java 1.2.2 does not have? Need it to assess if update is really needed and would cover identified issues. Thanks!

    @pbrockway2
    Thanks for the heads-up! Done that already but it seems Java 1.4.2 doesn't cover the bug fix for the issue that I'm covering for now. And with regards to "identified issues", I think that's for me to resolve and does not concern others.
    As for Sanjeev, I never felt sorry for anyone I've known in forums as with this guy. All I can say to him is good luck man!
    ---05----

  • Problems after patch abap/java sp04 to sp07 and cimmodel/cr data on PI7.1

    hello friends,
    after patch abap/java stack aan update cim model and cr content 3.00 to 4.xx, i have the following error by url:
    http://<hostname:50000>/dir
    error:
    Internal Error
    Internal error; contact your system administrator
    Internal error: Unable to start component DIRECTORY_SERVER. Specified StartupCodeEntry class "com.sap.aii.ibdir.server.applcomp.StartupCodeEntry" does not exist
    i have manually added the parameter in exchangeprofle, but what is the right value? is this the right way?
    Thanks,
    christoph

    Guys,
    Any success????
    I am working on PI 7.1. I m also facing same issue..... when I tried to upgrade SAP-XICONS and SAP_XIPCK component from SP 4.0 to 7.0.
    In my case the SLD, RWB and NWA is working... but I am not able to access
    http://pidev:50000/dir/start/index.jsp.
    The error says:
    Internal error: Unable to start component DIRECTORY_SERVER. Specified StartupCodeEntry class "com.sap.aii.ibdir.server.applcomp.StartupCodeEntry" does not exist
    deatiled error ************************
    Stacktrace
    Thrown:
    com.sap.aii.ib.core.applcomp.StartupException: Internal error: Unable to start component DIRECTORY_SERVER. Specified StartupCodeEntry class "com.sap.aii.ibdir.server.applcomp.StartupCodeEntry" does not exist
         at com.sap.aii.ib.core.applcomp.StartupException.newEntryClassNotFound(StartupException.java:78)
         at com.sap.aii.ib.core.applcomp.ExplicitApplicationComponentImpl.startup(ExplicitApplicationComponentImpl.java:101)
         at com.sap.aii.ib.core.applcomp.ExplicitApplicationComponents.startup(ExplicitApplicationComponents.java:438)
         at com.sap.aii.ib.core.applcomp.ApplicationComponent.startup(ApplicationComponent.java:203)
         at JEE_jsp_start_index_6931850_1232360340765_1232372432437._jspService(JEE_jsp_start_index_6931850_1232360340765_1232372432437.java:122)
         at com.sap.engine.services.servlets_jsp.lib.jspruntime.JspBase.service(JspBase.java:102)
         at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:66)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:433)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:240)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:66)
         at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:32)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:431)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:289)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:376)
         at com.sap.engine.services.servlets_jsp.filters.ServletSelector.process(ServletSelector.java:85)
         at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
         at com.sap.engine.services.servlets_jsp.filters.ApplicationSelector.process(ApplicationSelector.java:160)
         at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
         at com.sap.engine.services.httpserver.filters.WebContainerInvoker.process(WebContainerInvoker.java:67)
         at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
         at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
         at com.sap.engine.services.httpserver.filters.ResponseLogWriter.process(ResponseLogWriter.java:60)
         at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
         at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
         at com.sap.engine.services.httpserver.filters.DefineHostFilter.process(DefineHostFilter.java:27)
         at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
         at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
         at com.sap.engine.services.httpserver.filters.MonitoringFilter.process(MonitoringFilter.java:29)
         at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
         at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:71)
         at com.sap.engine.services.httpserver.server.Processor.chainedRequest(Processor.java:295)
         at com.sap.engine.services.httpserver.server.Processor$FCAProcessorThread.run(Processor.java:222)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:152)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:247)
    Initial Startup Exception
    Internal error: Unable to start component DIRECTORY_SERVER. Specified StartupCodeEntry class "com.sap.aii.ibdir.server.applcomp.StartupCodeEntry" does not exist
    Thrown:
    com.sap.aii.ib.core.applcomp.StartupException: Internal error: Unable to start component DIRECTORY_SERVER. Specified StartupCodeEntry class "com.sap.aii.ibdir.server.applcomp.StartupCodeEntry" does not exist
         at com.sap.aii.ib.core.applcomp.StartupException.newEntryClassNotFound(StartupException.java:78)
         at com.sap.aii.ib.core.applcomp.ExplicitApplicationComponentImpl.startup(ExplicitApplicationComponentImpl.java:101)
         at com.sap.aii.ib.core.applcomp.ExplicitApplicationComponents.startup(ExplicitApplicationComponents.java:438)
         at com.sap.aii.ib.core.applcomp.ApplicationComponent.startup(ApplicationComponent.java:203)
         at com.sap.aii.ibdir.server.cache.monitoring.CacheMonitorServlet.startup(CacheMonitorServlet.java:104)
         at com.sap.aii.ibdir.server.cache.monitoring.CacheMonitorServlet.init(CacheMonitorServlet.java:45)
         at javax.servlet.GenericServlet.init(GenericServlet.java:241)
         at com.sap.engine.services.servlets_jsp.server.security.PrivilegedActionImpl.run(PrivilegedActionImpl.java:97)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAs(Subject.java:396)
         at com.sap.engine.services.servlets_jsp.server.application.WebComponents.addServlet(WebComponents.java:341)
         at com.sap.engine.services.servlets_jsp.server.deploy.ApplicationThreadInitializer.loadServlets(ApplicationThreadInitializer.java:849)
         at com.sap.engine.services.servlets_jsp.server.deploy.ApplicationThreadInitializer.run(ApplicationThreadInitializer.java:219)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:152)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:247)
    Regards,
    Siddhesh S.Tawate

  • Please help, probleme de connection to database oracle and  java

    Ihave a problem to make connection to database Oracle when I use a simple code of java
    ======================
    import java.sql.*;
    public class Exemple1 {
    public static void main (String args[]) {
    Statement stmt = null;
    Connection con=null;
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    con = DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:GB","scott","tiger");
    catch (Exception e) { System.out.println(e);        }
    =================
    I have :
    * Linux (Fedora core3).
    * Oracle 10g
    My var. environ.:
    * ORACLE_HOME=/u01/app/oracle/product/10.1.0/Db_1
    * PATH=$ORACLE_HOME/bin
    * CLASSPATH=$ORACLE_HOME/jdbc/lib/ojdbc14.jar
    the error is:
    Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: oracle.sql.CharacterSet
    at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
    at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
    at JvResolvePoolEntry(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
    at oracle.jdbc.driver.DBConversion.DBConversion(short, short, short) (Unknown Source)
    at oracle.jdbc.driver.T4CConnection.connect(java.lang.String, java.util.Properties) (Unknown Source)
    at oracle.jdbc.driver.T4CConnection.logon() (Unknown Source)
    I don't know what's heppen exactly?

    If
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    is replaced
    with
    Class.forName("oracle.jdbc.driver.OracleDriver");does the java.lang.NoClassDefFoundError: while resolving class: oracle.sql.CharacterSet get generated?

  • What is the SQL command to list all tables in a access database(mdb)

    hi everyone
    can anybody tell me
    how to retreive and display total number of tables or total table name
    in a particular database in jsp page
    thank you .

    I dont think you can count the number of tables, maybe you mean number of rows in a table..If so, you need to make a method in your class and query to your database. Something like this:
    String count = "SELECT COUNT(*) FROM EMPLOYEES";
    Statement stmt = con.createStatement();
    rs = stmt.executeQuery(count);
    int rsInt = rs.getInt(1);The value of rsInt will result to the number of your tables.

  • Database design and pl/sql vs external procedures

    hi,
    My project involves predicting arrival time of a bus at a bus-stop, given statistical data of traffic patterns on the previous ‘n’(say 3) days, as well as the current location of the bus(latitude-longitude).
    Given current bus location, I derive my distance-until-destination bus-stop, which must be translated into time until arrival.
    Ive enlisted the triggers and procedures involved in making the prediction. Thse procedures especially the determination of perpendicular distances involve some complex trigonometric operations. I would like to know if my approach is correct and my database design is suited for the operations to b performed.
    Will it be more efficient to implement the procedures as external procedures or as pl/sql blocks
    This is my database design:
    LINKS ( a link is the road segment between adjacent bus-stops)
    LINK_ID                NUMBER      [PRIMARY-KEY]
    START_LATITUDE          NUMBER     
    START_LONGITUDE     NUMBER     
    START_STOP_ID          NUMBER
    END_LATITUDE          NUMBER
    END_LONGITUDE          NUMBER
    END_STOP_ID          NUMBER
    LINK_LENGTH          NUMBER
    BUS_ROUTE
    ROUTE_ID               NUMBER
    LINKS_ENROUTE          VARRAY(30) OF NUMBER
    STOPS_ENROOUTE          VARRAY(30) OF NUMBER
    TRACK(keeps track of current location of bus)
    BUS_ID           NUMBER          [PRIMARY-KEY]
    ROUTE          VARCHAR2(20)
    LATITUDE          NUMBER
    LONGITUDE          NUMBER
    TS               TIMESTAMP
    LINK_ID          NUMBER
    START_STOP     NUMBER
    END_STOP          NUMBER
    ARRIVAL_TIMES(actual arrival times of the bus, updated by track)
    BUS_ID           NUMBER     [PRIMARY-KEY]
    BUS_ROUTE          VARCHAR2(20)
    ARRIVAL          TIMESTAMP
    STOP_ID          NUMBER
    ETA (expected time of arrival)
    BUS_ID          NUMBER
    BUS_ROUTE          VARCHAR2(20)
    BUS_STOP_ID     NUMBER
    ARR_TIME          VARRAY(5) OF TIMESTAMP
    Triggers and procedures
    1)TRACK_TRIGGER
    On insert/update of track determine which link the us is currently on.
    Invoke a procedure that calculates perpendicular distance from current location to all links en-route (cursor on LINKS).
    Results are stored in a temporary table. Select the link-id of the tuple whose perpendicular distance is MINIMUM. This is the link the bus is currently on. Place link-id, start_stop_id and end_stop_id in corresponding row of TRACK.
    2)ARRIVAL_TRIGGER
    update ARRIVAL_TIMES.and store in ARRIVAL_TIMES that start-stop id with the time-stamp of the current track record.
    b)update ETA: Find the BUS-STOPS that come before the START_STOP of current track record. All these rows are deleted from the ETA tables, as the bus has already crossed these stops.
    3)Prediction Algorithm Procedure.
    Determine distance until destination for each STOP, 20 stops down from stop current location.
    Determine current avg. speed of the bus over a 2 hour window, by dividing total distance traveled by time taken.
    Calculate time-until arrival T1=current avg. speed * distance until destination
    From the records of previous ‘n’ days (say n=3) find those buses on the same route that were near the link the bus is currently on. Again determine avg speed over 2 hour window and calculate avg. speed.
    Calculate travel time T(i) = speed*distance until destination.     i.=2,3, 4…
    The final predicted arrival time is a weighted sum of all T(i).
    I hope Im not asking for too much, but the help would be greatly appreciated.
    Thankyou,
    Amina

    hello,
    actually i can manage ETA without a varray, since there will b a maxximum of 3 -4 values of expected arrival times at each stop. this can b done with separate columns.
    though i dont quite understand how lag() will help me...from what i understand lag() is to access values of previous rows. but in ETA table each element in the varray(if there is one) is going to be the expected arrival time of buses on a particular route at that particular stop, and is different from the arrival time at a previous stop(i.e.row).
    but for my other table BUS_ROUTE i have 2 varrays describing the links and stops enroute. in quite a few procedures i have to loop through these arrays and perform some calculations in every iteration is varray the best way 2 go, or nested tables?
    Thank you
    Amina
    As an aside, external procedures tend by their very
    nature to be slow - there's an overhead incurred
    each time we step outside the database. Therefore
    you really ought to avoid using a C extproc unless
    your calculations really cannot be done in PL/SQL or
    a Java Stored Procedure.
    Also, before you go down the VARRAY route you should
    consider the virues of analytic functions, notably
    [url=http://download-west.oracle.com/docs/cd/B1050
    1_01/server.920/a96540/functions56a.htm#83619]LAG()[/u
    rl]. I think you really ought to do some
    benchmarking of parformance before you start afdding
    denormalised columns like ETA. You may find the
    overhead in maintaining those columns exceeds their
    perceived benefits.
    Cheers, APC

Maybe you are looking for