Advantage Database Local server with JDBC - java

Hi I am trying to connect through JDBC on an Advantage local server.
I have tested many connections strings, like for example:
connection = DriverManager.getConnection(
"jdbc:extendedsystems:advantage://localhost:6262;catalog=C:\\bdl\\database\\BDL.add;TableType=cdx;LockType=proprietary", "adssys", "no");
I am searching for over three days now. I am getting always the error message connection refused. I only want to connect and access the files , and not on any advanced database server. I have now idea any more.

The ADS JDBC driver doesn't support ALS (Advantage Local Server), you have to install an actual ADS server.
http://devzone.advantagedatabase.com/dz/webhelp/Advantage10.1/devguide_ads_and_java_1.htm
If you have a running ADS server make sure there is no firewall that blocks traffic on port 6262 (or whatever port you're using).

Related

Connecting different user to 1 server(database derby) in netbeans using java

I made an inventory system in netbeans using the language java and i connect it to derby as my database it is already working as a whole system but I want to have a client-server functionality what I mean is I want my program to have a server which holds the database(different computer) and different users with different computers which they can save/view data at the same time to the database means they are connected in one network.
Working with multiple connections to a single database.
What code can I use or method or do I have to import something?
I did some research and the only thing that I found is socket which can be used to create a chat between server and a client.
But I only tried the IP 127.0.0.1 for the client since I am making running the server and the client in the same computer.
And also can I open the connection of the server in the client form and send data like SQLQuery so I can save it in the database of the server?
Where can I see examples for these? Please help thanks
Yes, Derby supports a client-server configuration of your application.
Deploying your application in the client-server configuration is straightforward:
Deploy the Derby Network Server, for example by running the startNetworkServer script that is included with the Derby distribution.
Ensure that derbyclient.jar is in your application's CLASSPATH, and that you register "org.apache.derby.jdbc.ClientDriver" with the JDBC DriverManager.
Change your JDBC Connection URL from jdbc:derby:<db details> to jdbc:derby://<host:port>/<db details>.
If this is your first time using Derby, I strongly recommend working your way through the Derby tutorial at https://db.apache.org/derby/docs/10.12/getstart/index.html
For more information about running the Derby Network Server to service database requests for your applications, read the Derby Admin Guide: https://db.apache.org/derby/docs/10.12/adminguide/index.html
Use the IP 0.0.0.0 or for all connections in the server. The the connection url should include the name of the server or the ip address of the server in the network. When you use ip 127.0.0.1 or localhost derby can only accept connections to the database in the same machine, in this case localhost. All of this can be done by your network application server

Native MySQL load balancing

Built Openfire XMPP Server with 2 MySQL database instances ("Master-Master" replicated servers). Trying to achieve database load balancing.
After googling, found native way to achieve load balancing.
http://dev.mysql.com/doc/connector-j/en/connector-j-usagenotes-j2ee-concepts-managing-load-balanced-connections.html
During XMPP installation, there is step where I can manually enter database connection string.
The question is
if my connection string will look like below
jdbc:mysql:loadbalance://[host1][:port],[host2][:port][,[host3][:port]]...[/[database]] »
[?propertyName1=propertyValue1[&propertyName2=propertyValue2]...]
will Java's MySQL driver balance connection between multiple servers regardless of which application uses it?
BTW,
There is, database connection statistics on XMPP server. I refresh every time, and it shows me only 1 IP as Database IP. Not randomly changing MySQL servers' ip addresses (from JDBC conection string).

The Network Adapter could not establish connection Oracle 12c

I have an oracle12c database setup on my windows 8 machine & I am trying to access this database through JDBC from ubuntu(Linux) machine present in local area network.
When am trying to establish connection through JDBC, getting the following exception
The network adapter could not establish connection.
I have ensured the following.
1. Disabled the firewalls between both the machines.
2. the URL is proper & I tired using both hostname as well as ip address.
3. listener is up and running on port 1521.(lsnrctl stat shows the listener is READY)
I have done extensive google search about this. Please help.
Thanks in advance. Please let me know if you need more details.
make sure you have used proper jdbc driver for that database connection.
try to telnet the computer (Windows 8) that is running DB from client computer (Ubuntu).

do i need a tomcat server to make java jdbc swing application to run on lan

I am attempting to create a MySQL and Java client app for my home network.On the server machine I successfully connected to the MySQL as root
Now I want to connect to MySQL from my client PC using the Java client program,
How to do this??
Do i need to install Tomcat Server to run on server for this.
I am using Windows 7 on all my clients and server machines.
Tomcat server is used for web applications.You just need to create a JDBC code and in the URL string just give the ip address of the system where mysql is installed.For example
connection = DriverManager
.getConnection("jdbc:mysql://192.168.1.205:3306/database_name","root", "password");
Also if you have not granted the permission in mysql then grant it .See this for granting permission for access to mysql on remote system
Depending on what you want to achieve, you need to establish a JDBC connection to the server. Take a look at the JDBC trail for more details.
This will allow you to connect directly from you client machine to your database server. This would be done using the required JDBC connection URL for the MySQL connection, for example jdbc:mysql://[host][,failoverhost...][:port]/[database] »
[?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]..., check out Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J for more details.
You may also need to configure your MySQL server to allow remote access before you can connect
You just need to do two things:
Make sure the server hosting MySQL allows incoming connections
Write JDBC code and use your MySQL server hostname/ipaddress in the jdbc string to connect and use it.

java mysql connection across network

I need to connect to a mysql database across a network.
The connection string ive given is
"jdbc:mysql://host/dbname"
i can access the site across the network but the only problem is with the java database connection.
Ive updated the phpmyadmin.conf file giving
# Deny from all
Allow from all
But still the database connection cannot be made.
Please help me..
I don't know much aboud phpmyadmin, but what I did to configure a remote db:
The connection string is: jdbc:mysql://host:port/dbname
The port is 3306 by default
The mysql user is often name#localhost, you need to configure a user for the remote (client) machine (IP address, hostname, wildcard)
HTH
Ok, there are few things you need to check ...
1) If your database got username/password
2) Have you restarted your server after altering phpmyadmin.conf?
3) Make sure you are connecting to the correct port. Ex: mysql://host:port/dbname (if port differs from default.
4) make sure that the PC that have the DB allows incoming connections through the port.
If you still facing problems, try disabling your antivirus/firewall on the PC that have the DM and try.

Categories

Resources