Driver JDBC PostgreSQL with Android
While not the strict answer to your question, I do have a suggestion.
Don't try to use JDBC on the Android device directly. You'll save a lot of hassle that way. I wrote about that in more detail on the "JDBC vs Web Service for Android" question.
Write your database logic on a web-accessible application server and talk to that application server via HTTP+JSON, SOAP, XML-RPC, or similar. This will be a lot more bandwidth efficient and you can make your app a lot more tolerant of issues with connectivity that way. It also saves you from having to expose your database server directly to the Internet - not much of a worry with PostgreSQL so long as you use SSL, but still better not to have to do at all.
Using JAX-RS on JBoss AS 7, Tomcat 7, or similar you should be able to put together a web RESTful XML/JSON services API for your app pretty easily. People also seem to put REST/JSON APIs together pretty quickly with PHP.
You can write a JSON/REST web API in pretty much any language you like with varying degrees of ease. Just search for REST server yourlanguagename
.
"Kaw" has pointed out in a deleted answer that there are also virtual JDBC drivers that tunnel requests over HTTP. These may be suitable for some applications.
df.show returning java.lang.ClassNotFoundException: org.postgresql.Driver
I resolved this problem by adding the following parameters in the Zeppelin interpreter menu:
spark.driver.extraClassPath=/home/hadoop/postgresql-42.2.18.jar
spark.jars.packages=org.postgresql:postgresql:42.2.18
Spring Data java configuration doesn't find the org.postgresql.Driver
In case you need any class from the Postgres JDBC jar, Modify your dependency to provided. If not just remove it.
<!-- Postgres -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4-1205-jdbc42</version>
<scope>provided</scope>
</dependency>
And then add the Postgres JDBC jar to the lib path of tomcat
{tomcat7_home_path}/lib
java.lang.ClassNotFoundException: org.postgresql.Driver with Maven
With your pom.xml
the following should work
create the application
mvn package
run your application
cd target/
java -jar Monitoring-1.0-SNAPSHOT.jar
assuming Monitor.java
as
public class Monitor {
public static void main(String[] args) throws Exception {
Class.forName("org.postgresql.Driver");
System.out.println("Hello driver");
}
}
the steps on top will print
Hello driver
To run your application all the jar files from target/*.jar
must be in the same directory as the Monitoring-1.0-SNAPSHOT.jar
.
Related Topics
How to Change Size of Title's Text on Action Bar
Pixel-Perfect Collision Detection Android
Adding Header to All Request with Retrofit 2
How to Override Action Bar Back Button in Android
Get Button Coordinates and Detect If Finger Is Over Them - Android
How to Encode String (Use Encrypt Messagedigest in Java) to Base64 String in Swift
How to Pass an Arraylist to a Varargs Method Parameter
Reading in from System.In - Java
:App:Dexdebug Execexception Finished with Non-Zero Exit Value 2
Method Called After Release() Exception Unable to Resume with Android Camera
How to Move Firebase Child from One Node to Another in Android
Add Object to Arraylist at Specified Index
Convert String to Date in Java
Converting Epoch Time to Date String
How to Do a Cross Platform Encryption Method Working in Both iOS and Android (Aes Encryption Only..)