Netbeans DB Connectivity

When i normally would deploy a web app under a stand alone tomcat i would have the following code
<Context path="/micro" docBase="micro" debug="0" reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="dating_log." suffix=".txt"
timestamp="true"/>
<Resource name="jdbc/MYSQL" auth="Container" type="javax.sql.DataSource"
maxActive="0" maxIdle="30" maxWait="10000"
username="root" password="root" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/micro?useUnicode=true"/>
</Context>
However the above code does not work when i edit netbeans' tomcat server.xml file. Instead i am getting various error such as
java.lang.IllegalArgumentException: Document base C:\Documents and Settings\costas\.netbeans\5.0beta2\jakarta-tomcat-5.5.9_base\webapps\micro does not exist or is not a readable directory
Where should i declare the DB resource for the specific application, if i am not allowed to edit the server.xml file ?
I was wondering what i am doing wrong. The MySQL driver is usually under the tomcats common/lib folder. Should it be there under netbeans' tomcat as well ?
Thanx a lot,
C.

I've found the answer to my own question. I was working with legacy code from another programmer who had named the Date/Time field "Date". Since this is a Reserved Word, when I tried use that tag to specify a field to Insert Into, the DB Toolset interpreted the tag as a specific SQL request rather than as the name of a separate field. The fix was simply to rename that field to JunkDate (or whatever) and then the rest of the Cat String-based SQL Insert Into statement worked fine. Shows the problem of simply using legacy code, esp when it was targetted for a different platform (viz VB) and was done by a very sloppy programmer....

Similar Messages

  • Netbeans database connectivity problem

    want to connect or bind label to database ms access
    i am using netbeans 5.5.1
    how can i do it

    I have no idea what you're talking about, but here's a JDBC tutorial. Start with it: [http://java.sun.com/docs/books/tutorial/jdbc/index.html]. JDBC prerequire basic SQL knowledge: [http://www.w3schools.com/SQl/default.asp].

  • App won't execute unless netbeans is open & connected to derby db

    My desktop database app doesn't run unless Netbeans has connected to the DERBY (network) database it uses, so my deployed .jar is useless unless Netbeans is open.
    Running it from the command line, it gives me the following error indicating it can't connect to the DERBY server, as if the db isn't running or something.
    Anyone here mind pointing out why the database doesn't run when called and what I can do to fix it (if that is my problem?
    SEVERE: Application class project.ProjectApp failed to launch
    Local Exception Stack:
    Internal Exception: java.sql.SQLNonTransientConnectionException: java.net.ConnectException : [color="red"]Error connecting to server localhost on port 1527 with message Connection refused: connect.[/red]
    Error Code: 40000
            at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305)
            at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:102)
            at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:184)
            at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)
            at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login (EntityManagerFactoryProvider.java:280)
            at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:229)
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93)
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:126)
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:120)
            at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:91)
            at project.ProjectView.initComponents(ProjectView.java:361)
            at project.ProjectView.<init>(ProjectView.java:60)
            at project.ProjectApp.startup(ProjectApp.java:26)
            at org.jdesktop.application.Application$1.run(Application.java:171)
            at java.awt.event.InvocationEvent.dispatch(Unknown Source)
            at java.awt.EventQueue.dispatchEvent(Unknown Source)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.sql.SQLNonTransientConnectionException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
            at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
            at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
            at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:100)
            ... 20 more
    Caused by: org.apache.derby.client.am.DisconnectException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
            at org.apache.derby.client.net.NetAgent.<init>(Unknown Source)
            at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)
            at org.apache.derby.client.am.Connection.<init>(Unknown Source)
            at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
            at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
            at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source)
            ... 24 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(Unknown Source)
            at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
            at java.net.PlainSocketImpl.connect(Unknown Source)
            at java.net.SocksSocketImpl.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at javax.net.DefaultSocketFactory.createSocket(Unknown Source)
            at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            ... 30 more
    Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class project.ProjectApp failed to launch
            at org.jdesktop.application.Application$1.run(Application.java:177)
            at java.awt.event.InvocationEvent.dispatch(Unknown Source)
            at java.awt.EventQueue.dispatchEvent(Unknown Source)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.run(Unknown Source){code}
    Edited by: gpxtc02 on May 6, 2010 4:45 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    gpxtc02 wrote:
    I understand that. but what can I do to run the database so that the client can access it on .jar execution? That question is unclear to me.
    Again as you are currently running it you must have a stand alone server running somewhere. That is a different application than your client.
    If you want to run it embedded which is not the way you are doing it now then you must modify your code so it uses the embedded mode.

  • Nullpointerexception when connecting to database

    I am trying to connect to an oracle database. I can get successfully connected using the netbeans database connection wizard. I transferred over the same driver and connection string to my code. I am currently getting this error when connecting. I commented on the line of code where i am receiving the error below. Any help is appreciated. thanks
    NPE exception in creating statement null
    java.lang.NullPointerException
    at mmsiserver.conversation.doAction(conversation.java:115)
    at mmsiserver.conversation.<init>(conversation.java:101)
    at mmsiserver.Server.run(Server.java:105)
    public conversation(Socket clientSocket) {
            System.out.println("beginning of convo");
            client = clientSocket;
            Connection connection = null;
            try {
                objOut = new ObjectOutputStream(client.getOutputStream());
                objIn = new ObjectInputStream(client.getInputStream());
            } catch (IOException ex) {
                ex.printStackTrace();
            try {
                // Load the JDBC driver
                // DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                String driverName = "oracle.jdbc.driver.OracleDriver";
                Class.forName(driverName);
                String url = "jdbc:oracle:thin:@139.67.66.27:1521:XE";
                String username = "system";
                String password = "mmsi";
                connection = DriverManager.getConnection(url, username, password);
            } catch (ClassNotFoundException e) {
                System.out.println("clnf exception in connection to db");
            } catch (SQLException e) {
                System.out.println("sql ex in connecting to db");
            this.start();
            doAction();
            public void doAction() {
            Statement stmnt = null;  // used in executing static SQL statement returns results it produces
            System.out.println("got to doaction");
            try {
               // it errors out on this next line.
                stmnt = connection.createStatement();
            } catch(SQLException e) {
                System.out.println("SQL Exception " + e.getMessage());
            } catch (NullPointerException npe){
                System.out.println("NPE exception in creating statement ");
                npe.printStackTrace();
          

    Your conversation constructor is using a different variable named "connection" from the one that the doAction method is using. You didn't show it, but you must have an instance variable named "connection" in order for doAction to compile.
    To fix: in the conversation constructor, don't say:
    Connection connection = null;Then the following line (that you already have) will initialize the same variable that doAction sees:
    connection = DriverManager.getConnection(url, username, password);

  • Netbeans and Firebird DB

    I'm trying to get Netbeans to connect to a Firebird database so I can try out the basic database application template. I am able to make a connection and it logs in to the database. It then takes me to the Advanced tab and asks about which database schema I want to use. However, the drop down box is grayed-out and when I click the "Get Schemas" button, the drop down box remains grayed-out. If I click OK it takes me to the "Master Table" screen. The list of tables in my database does appear in the Database Table drop down, but no matter which one of the tables I select, the Available Columns box remains empty. What gives?

    Hi Chris,
    I really appreciate your help.
    Ids are generated by by the database (Firebase) virtue of a trigger, which use a generator. Thus:-
    TRIG_SV_JOB_OPERATIVE_1 before insert Active 0
    AS
    BEGIN
    IF(NEW.ID IS NULL) THEN
    NEW.ID = GEN_ID(GEN_PK_SV_JOB_OPERATIVE, 1);
    END
    I am using JPA Toplink/Essentials not EclipseLink.
    Below are details of version:-
    toplink-essentials.jar:-
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.5
    Created-By: 1.5.0_14-b03 (Sun Microsystems Inc.)
    Extension-Name: javax.persistence
    Specification-Title: Java Persistence API
    Specification-Version: 1.0
    Specification-Vendor: Sun Microsystems, Inc., Oracle Corp.
    Implementation-Title: TopLink Essentials
    Implementation-Vendor: Sun Microsystems, Inc., Oracle Corp.
    Implementation-Vendor-Id: oracle.toplink.essentials
    Implementation-Version: 2.0.1-b09d-fcs (12/06/2007)
    Premain-Class: oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPIn
    itializerAgent
    toplink-essentials-agent.jar:-
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.5
    Created-By: 1.5.0_14-b03 (Sun Microsystems Inc.)
    Extension-Name: oracle.toplink.essentials.agent
    Specification-Title: Java Persistence API
    Specification-Version: 1.0
    Specification-Vendor: Sun Microsystems, Inc., Oracle Corp.
    Implementation-Title: TopLink Essentials
    Implementation-Vendor: Sun Microsystems, Inc., Oracle Corp.
    Implementation-Vendor-Id: oracle.toplink.essentials
    Implementation-Version: 2.0.1-b09d-fcs (12/06/2007)
    Premain-Class: oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPIn
    itializerAgent
    Class-Path: toplink-essentials.jar
    Regards
    Nick

  • Proxy client (over USB connection) with DHCP assigned IP address doesn't work with FRDM-K64F

    Hello,
    after reading about the issues on this forum with a static IP address on the Freescale FRDM-K64F board I went for an DHCP address but I can't get the proxy client to work over a USB connection with DHCP either.
    My console tells me the following:
    RTC Time: Wed 2014-01-01 00:07:27
    Network initialized
    IP Address:      10.143.xxx.yyy (xxx and yyy is real numbers, just changing them for the forum to letters)
    Subnet mask:     255.255.252.0
    Gateway:         10.143.xxx.yyy
    MAC-address:     00:0c:00:06:70:00
    And when I try o to connect with the following command :
    java -jar proxy.jar -socket 10.143.xxx.yyy
    I get the following output and no CLI interface:
    Trying to open socket connection with device: 10.143.xxx.yyy:2201
    Connected to the socket: Socket[addr=/10.143.xxx.yyy,port=2201,localport=49605]
    Open channel 8 with hash 0x130399b3
    Channel 8 CLOSED -> OPENED
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 OPENED -> AVAILABLE
    Open channel 9 with hash 0x0
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    I don't know if this matter but my java version is:
    java version "1.8.0_31"
    Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
    Any ideas or am I missing something completely?
    Thanks
    Andy

    Hi, Andy. Please excuse my ignorance, I am very new at this ME embedded stuff. I had my challenges, but was finally able to get my board up with a static address. I went through a lot of headaches, but finally got the board flashed with the latest bin. I then updated the jwc_properties.ini file on the SD card to include:
    # Whether static configuration or DHCP server is used do get IP address. Possible values: dhcp,static
    ip.method = static
    # IP address,used with static IP configuration only
    ip.addr = 192.168.0.30
    # Network mask,used with static IP configuration only
    ip.netmask = 255.255.255.0
    # Network gateway,used with static IP configuration only
    ip.gateway = 192.168.0.1
    # DNS server,used with static IP configuration only
    ip.dns = 208.67.222.222
    # MAC address
    mac.addr = 01:02:03:04:05:06
    I was then put the card into the board, disconnected both USB cables, and then powered it up. From that point I was able to ping the board. I can now use Device Manager in NetBeans to connect to the device.
    I am struggling quite a bit with many issues. It seems that when I try to stop the app from NetBeans, the "please wait" dialog hangs forever. I have to use Windows Task Manager to kill the "JavaW" process tree and reconnect the board.
    I have also had trouble understanding the GPIO pin assignments. Another gotcha was trying to use the AutoStart feature. Since the sample app never cleanly exited, I thought that I bricked the board. The secret is to power it down, remove the SD card, and then delete all files EXCEPT the jwc_properties.ini file, put the SD card back in, then power up. It seems that the board forgets that the MIDlet was installed.
    Hope this helps others out there.
    Please everybody, post your experiences here. There seem to be very few of us, and finding pearls in the dust is rare right now.
    Regards,
    Pete

  • Netbeans Mobility Pack Phone Compatibility

    Hi friends.
    I am new to mobile programming but I intend to use NetBeans to try out. I just need NetBeans to connect to my mobile phone (LGB2050) so as to upload even the test applications. How do I go about this? Thanks.

    yes
    yes, if you use 5.0 just go to Tools | Update center, choose Java ME and WTK
    1.0.4 and the IDE will download and install it for you
    yes

  • Web Interface doesn't work after installing 11g

    A couple days ago I decided to install Oracle 11g (after already having 10g Express Edition), after successfully installing 11g, I tried to access 10g EE using http://127.0.0.1:8080/apex/apex, and it doesn't work anymore. I tried using a java program with Netbeans that connects to my 10g Database and there's connection with no problems and I can upload/download data with no problems, I just can't access the web interface.
    Thanks in advance.

    jalvarito wrote:
    A couple days ago I decided to install Oracle 11g (after already having 10g Express Edition), after successfully installing 11g, I tried to access 10g EE using http://127.0.0.1:8080/apex/apex, and it doesn't work anymore. I tried using a java program with Netbeans that connects to my 10g Database and there's connection with no problems and I can upload/download data with no problems, I just can't access the web interface.
    Thanks in advance.And the error message is . . . ????

  • War incompabilities with SOA 7 Platform edition?

    Hi,
    I am beggining to try Sun One App server 7 Platform edition.
    I developed a small web application to try database connections with pool and without pool. So I created the application in Netbeans to connect to an AS400 and worked OK with Tomcat.
    Also I installed Eclipse 2.12 and Resin and also everything went OK.
    When I get to SOA7, I created the connection pool, then the jdbc resources and finally the web app which I imported as a WAR file.
    But it seems that the server need some files in the /j2ee-modules/appname directory and others in docroot/appname.
    I thought that the server admin takes care of everything and the app will be correctly deployed as any j2ee server I tried.
    Can you help me? Thanks
    BTW I included at the end of the message, the error appeared in the console.
    Thanks you so much,
    Lorenzo Jim�nez
    INFO: CORE5076: Using [Java HotSpot(TM) Server VM, Version 1.4.2_03] from [Sun M
    icrosystems Inc.]
    INFO: JMS5023: JMS service successfully started. Instance Name = domain1_server1
    , Home = [C:\Java\AppServer7\imq\bin].
    INFO: JTS5014: Recoverable JTS instance, serverId = [100]
    INFO: RAR5060: Install JDBC Datasources ...
    INFO: RAR5059: Binding [JDBC DataSource Name: jdbc/dinamica2, Pool Name: AS400Po
    ol]
    INFO: JMS5015: Install JMS resources ...
    INFO: WEB0100: Loading web module [pool] in virtual server [server1] at [pool]
    SEVERE: WEB0101: Error loading web module [pool] in virtual server [server1]: ja
    vax.naming.InvalidNameException: Real JNDI name cannot be empty for jdbc/dinamic
    a2
    INFO: HTTP3072: HTTP listener http-listener-1 [http://I01356:80] ready to accept
    requests
    startup: server started successfully
    INFO: CORE3274: successful server startup
    INFO: CORE5053: Application onReady complete.

    I tried 3 ways:
    Generating from Netbeans 3.5, then Netbean 3.6 Beta and finally Eclipse.
    SOA7 receives the war file but when executing it dont find the files.

  • Derby travel db not working

    Hi forum, I have a problem with the Derby server that comes with the sjsas 9, the server runs ok from the menu start->programs->Sun Microsystems->Application Server PE 9->Start JavaDB, but when I try to get a connection from NetBeans 5.5 Runtime,Databases,jdbc:derby://localhost:1527/travel, I get a message window with the text:
    The application server rejected establishment of the connection. An attempt was made to access a database, travel, which was not found.
    Can the root of problem be that I had the glassfish installed before the install of sjsas 9, and then I remove the first )deleting the folder of glassfish)? Or maybe it can be because I installed a sjsas 8 after the installation of sjsas 9 and don�t remove the last?

    derby databases will be created in derby's home dir.
    Every GF installation will have derby bundled.
    For eg. If you have created your database with GF-first-installation, and now you have started database of GF-second-installation, "travel" will be looked at GF-second-installation's derby install dir.
    Insteady, if you can find where the dir "travel" [typically in GF_INSTALL/databases], when you start the database using "asadmin start-database" provide --dbhome option with the path of "travel" database.
    http://docs.sun.com/app/docs/doc/819-3662/6n5s9hn2a?a=view
    or change the netbeans derby connection url to point absolute path of database
    eg:
    jdbc:derby:ABSOL_PATH/travel;
    Thanks,
    -Jagadish

  • Servlet database problem

    Hi iam sending text message from client and storing it in file in server....I want to store text value in database..
    I am doing following this to store text in database..............
    I am using Netbeans to connect to database....I have added classes12.jar of oracle to my servlet program............when ever i type select * from store; in database
    it says no rows selected plz let me know how i can insert text into data base............
    FileOutputStream fout = new FileOutputStream("image.jpg");     
                   StringBuffer message = new StringBuffer();
                   StringBuffer imageData = new StringBuffer();
                   while((line = r.readLine())!=null)
                        buf.append(line);
                   String s = buf.toString();
                   byte[] data = s.getBytes();
                   fout.write(data);
                   fout.close();
                   Class.forName("Oracle.jdbc.driver.OracleDriver");
                   Connection con = DriverManager.getConnection(
         "jdbc:oracle:this:@localhost:1521:orcl","scott", "tiger");
                   Statement st = con.createStatement();
                   response.setContentType("text/plain");
                   PrintWriter out = response.getWriter();
                   st.executeQuery("insert into store values('" + message + "','" + imageData + "'");
                   out.print("Inserted Successfully..");
                   out.print("Data Gathered recieved is "+ s);
    Thanks,

    {color:#000080}Not sure, but you may need to flush() the OutputStream.fout.write(data);
    fout.flush();
    fout.close();To post code, use code tags --{color} [code]CODE[/code] {color:#000080}is displayed as CODEdb{color}

  • Searching through a database table from a java GUI

    i've created a java GUI using Netbeans which connects to a derby database. a table from this database is placed in my GUI, containing some text in all its rows. Now, i want to create a search function that will look for a given string of text through this table and output the results somewhere. can anyone please give me some tips on how i might go about doing this?
    thanks,
    Karan

    You may put a radio button or check box next to the column name.
    You can also put a drop down list contains option "start by", "end by", "contains" matched to SQL like statement, '%XX', 'XX%' and '%XX' respectively.
    You may also make the column name as a button which user can selected the ordering preference - ascending, descending, default.

  • WL-Proxy-Client-IP returns localhost IP address

    Hello, everyone.
    I am trying to find out client' IP address. Both request.getRemoteAddr() and
    request.getHeader("WL-Proxy-Client-IP") return the value of the localhost IP address
    127.0.0.1
    Have anyone seen such behavior?
    Gela

    Hi, Andy. Please excuse my ignorance, I am very new at this ME embedded stuff. I had my challenges, but was finally able to get my board up with a static address. I went through a lot of headaches, but finally got the board flashed with the latest bin. I then updated the jwc_properties.ini file on the SD card to include:
    # Whether static configuration or DHCP server is used do get IP address. Possible values: dhcp,static
    ip.method = static
    # IP address,used with static IP configuration only
    ip.addr = 192.168.0.30
    # Network mask,used with static IP configuration only
    ip.netmask = 255.255.255.0
    # Network gateway,used with static IP configuration only
    ip.gateway = 192.168.0.1
    # DNS server,used with static IP configuration only
    ip.dns = 208.67.222.222
    # MAC address
    mac.addr = 01:02:03:04:05:06
    I was then put the card into the board, disconnected both USB cables, and then powered it up. From that point I was able to ping the board. I can now use Device Manager in NetBeans to connect to the device.
    I am struggling quite a bit with many issues. It seems that when I try to stop the app from NetBeans, the "please wait" dialog hangs forever. I have to use Windows Task Manager to kill the "JavaW" process tree and reconnect the board.
    I have also had trouble understanding the GPIO pin assignments. Another gotcha was trying to use the AutoStart feature. Since the sample app never cleanly exited, I thought that I bricked the board. The secret is to power it down, remove the SD card, and then delete all files EXCEPT the jwc_properties.ini file, put the SD card back in, then power up. It seems that the board forgets that the MIDlet was installed.
    Hope this helps others out there.
    Please everybody, post your experiences here. There seem to be very few of us, and finding pearls in the dust is rare right now.
    Regards,
    Pete

  • How to create a connection pooling in Netbeans 6.0 using the oracle driver

    hi all,
    I am using Netbeans 6.0. Apache Tomcat 6.0.14 server, oracle 9i.
    I tried to create a connection pooling using tomcat web server.
    I have included the following code in context.xml and web.xml.
    CONTEXT.XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/network1">
    <Resource name="jdbc/myoracle"
    auth="Container"
    type="javax.sql.DataSource"
    username="scott"
    password="tiger"
    factory="BasicDataSourceFactory"
    driverClassName="oracle.jdbc.OracleDriver"
    url="jdbc:odbc:thin:@127.0.0.1:1521:mydb"
    maxActive="20"
    maxIdle="10"
    maxwait="-1"/>
    </Context>
    WEB.XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <resource-ref>
    <description>Oracle Datasource example</description>
    <res-ref-name>jdbc/myoracle</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    After that i have included the following JDBC driver's jar files in the $Catalina_Home/lib folder.
    classes 111.jar,
    classes 111_g.jar
    classes12.jar
    classes 12_g.jar
    classes12dms.jar
    classes12dms_g.jar
    nls_charset11.jar
    nls_charset12.jar
    ocrs12.jar
    ojdbc14.jar
    ojdbc14_g.jar
    Then i stop the tomcat web server and start it again.
    In jsp page i have included the following code:
    Context ctx=new InitialContext();
    Context envctx=(Context)ctx.lookup("java:comp:env");
    DataSource ds=(DataSource)envctx.lookup("jdbc/myoracle");
    Connection con=ds.getConnection(); ----->(In this line an error occured that Connection class cannot be found.)
    please help me how to create a connection pooling and rectify the error in conneciton.
    Thanks in advance

    Please refer
    http://www.netbeans.org/kb/60/web/customer-book.html

  • How do i connect to a derby database created in Netbeans externally?

    I've created a a Java DB in Netbeans, I can connect to the Java DB server and then to my database from Netbeans. I need to use this database outside of Netbeans... a table from this database is used in a program which i created with netbeans... i open the program using the .jar file outside of netbeans... but i can't access the table.
    can anyone help me with this?

    what exactly are you wanting to do? to connect to the database i use this
    String driverName = "org.apache.derby.jdbc.ClientDriver";
                Class.forName(driverName);
                String url = "jdbc:derby://localhost:1527/table name";
                String username = "username";
                String password = "password";
                connection = DriverManager.getConnection(url, username, password);you need to make sure that you have the derbyclient.jar file in the librarie for your project.
    Message was edited by:
    developprograms

Maybe you are looking for