Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have my application in system1.Inside my Application it has bin and db. Db is not in SQL sever.
Here I need to access that db from System1 to System2

Can anyone pls help
Thanks in advance :(
Posted
Comments
ZurdoDev 4-Apr-13 8:39am    
DB needs to be loaded into a SQL server instance.
Usha Muhunthan 4-Apr-13 8:49am    
Can't i access the DB by using Remote connection if its not in Server instance
[no name] 4-Apr-13 8:53am    
Not if it is a SQL Server database. It must be hosted in SQL Server.
Usha Muhunthan 4-Apr-13 8:55am    
Oh great thank u . Can i use anyother database like access

1 solution

C#
You Have to try this code..
try{
Class.forName(DRIVER);
connection = DriverManager.getConnection("jdbc:mysql://localhost/db_name",root,password);

}catch(Exception ex){
JOptionPane.showMessageDialog(null, ex.getMessage(),"Unable to connect",JOptionPane.ERROR_MESSAGE);
}

this code for the client

try{
Class.forName(DRIVER);
connection = DriverManager.getConnection("jdbc:mysql://169.254.214.132",client_name,password);

}catch(Exception ex){
JOptionPane.showMessageDialog(null, ex.getMessage(),"Unable to connect",JOptionPane.ERROR_MESSAGE);
}
 
Share this answer
 
Comments
[no name] 4-Apr-13 9:42am    
Why does he have to try this code? He is not using MySql and he is not using java.
Usha Muhunthan 5-Apr-13 7:01am    
Thank u Rakesh Meel

I am sorry i am new to client server i dont know where to write this coding and can you please tell me what the class.forName(DRIVER) means.If possible explain the coding please

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900