netbean project not working outside Ide

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

netbean project not working outside Ide

lamsalsandeep
Hi frnds
i am new in java , i have develop a small application in netbeans ide and its work fine after clean&build in my laptop but the problem is that when i move the dist folder (which is create after clean&build)  to another laptop and run the executable file the form is open and when i insert the values for field and click the save button  it show error
"java.sql.SQLRecoverableException:IO":The Network Adapter could not establish the connection
why ??? i have create my database in oracle10g local host.
used ojdbc6 driver

below is my database connection code:
public class JavaConnectDb {
    public static Connection Connerdb(){
        try{
            Class.forName("oracle.jdbc.OracleDriver");
            Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","username","password");
         
            return con;
        }catch(ClassNotFoundException | SQLException e){
           
            JOptionPane.showMessageDialog(null, e);
        }
        return null;
       
    }
   
}

i appreciate your fast reply
thank you [/u]




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: netbean project not working outside Ide

markwade
You're accessing an Oracle database local to your laptop that you are
developing on.  When you move the app to the other laptop does it also
have an a Oracle DB running on it with a duplicated DB and the same
connection parameters (user, password, port) that can be accessed as
"localhost"?  If you have, then everything has to be equal; DB,
username, password, port, schema owner, etc...


On 04/09/2017 04:26 AM, lamsalsandeep wrote:

> Hi frnds
> i am new in java , i have develop a small application in netbeans ide and its work fine after clean&build in my laptop but the problem is that when i move the dist folder (which is create after clean&build)  to another laptop and run the executable file the form is open and when i insert the values for field and click the save button  it show error
> "java.sql.SQLRecoverableException:IO":The Network Adapter could not establish the connection
> why ??? i have create my database in oracle10g local host.
> used ojdbc6 driver
>
> below is my database connection code:
> public class JavaConnectDb {
>      public static Connection Connerdb(){
>          try{
>              Class.forName("oracle.jdbc.OracleDriver");
>              Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","username","password");
>            
>              return con;
>          }catch(ClassNotFoundException | SQLException e){
>              
>              JOptionPane.showMessageDialog(null, e);
>          }
>          return null;
>          
>      }
>      
> }
>
> i appreciate your fast reply
> thank you [/u]
>
>
>
>
>

Loading...