Having trouble with connecting SQLite in host Java
I'm trying to connect my SQLite database which i made with firefox
plugin.It's including some table contents . I uploaded it to our online
host. I 'm trying to write this program for 4 of my friend. So we need to
connect this database file. But i cant show the route to program. I know
host's IP,password etc etc. I need just connect the host. This is how i'm
trying to connect database.
PS: In this code which i will give below this PS, i'm just connecting to
localhost. But i need to connect a host(IP) For example Connect to
XXX.XX.XX(just random ip) and locate it sqlite file under C:
PS2:Host including a password, should everyone need this ?
PS3:I'm working with netbeans.
import java.sql.*;
import javax.swing.*;
public class javaconnect {
Connection conn=null;
public static Connection ConnecrDb(){
try{
Class.forName("org.sqlite.JDBC");
Connection conn
=DriverManager.getConnection("jdbc:sqlite:C:\\XX.sqlite");
return conn;
}catch (Exception e){
JOptionPane.showMessageDialog(null, e);
return null;
}
No comments:
Post a Comment