How to establish the connection - Best Practice

Following is my code for database connection
import java.sql.Connection;
import java.sql.DriverManager;
import oracle.jdbc.driver.OracleDriver;
public class DBConnect
     private static Connection connection = null;
     static
          try
               DriverManager.registerDriver( new OracleDriver() );
               String url = "jdbc:oracle:thin:@dbserver:1521:ORCL";
               connection = DriverManager.getConnection( url, "user", "password" );
          catch ( Exception e )
     private DBConnect()
     public static synchronized Connection getConnection()
          return connection;
}Tell me the Best Practice to establish the connection.
Edited by: shashiwagh on Feb 1, 2010 11:25 AM
Edited by: shashiwagh on Feb 1, 2010 11:26 AM

First, handle your exceptions properly.
Second, you should not normally create static database connections.
Third, hardcoding connection data like that is not a good idea.

Similar Messages

  • How to establish the connection between crm and r/3

    Hi,
    Sorry for posting this question in this forum, i did not find any CRM forums.My question is,How to establish the connection between CRM and R/3...in my office i installed standard alone CRM system,but it is not talking to R/3.
    Could any one tell me where to find adapters and plugins for this.
    Thanks in advance.
    Ajey

    Hello Ajey,
    in the case you mean the connection between R/3 and SAP CRM you should read the Best Practice Guides:
    B01: CRM Generation
    C71: CRM Connectivity
    B09: CRM Replication
    from http://help.sap.com/bp_crmv240/index.htm. There is a CRM Forum at http://www.sap.com/community/ and also at http://www.sapfans.com/.
    Regards
    Gregor

  • Where does one find the Oracle Best Practice/recommendations for how to DR

    What is the Oracle Best Practice for install/deployment and configuration of ODI 11g for Disaster Recovery?
    We have a project that is using Oracle ODI 11g (11.1.1.5).
    We have configured all the other Oracle FMW components as per the Oracle DR EDG guides. Basically using the Host ip name/aliasing concept to ‘trick’ the secondary site into thinking
    it is primary and continue working with minimal (or no) manual reconfiguration. But will this work for ODI? The FMW DR guide has sections for SOA, WebCenter and IdM, but nothing for ODI.
    Since ODI stores so much configuration information in the Master Repository..when this DB gets ‘data guarded’ to the secondary site and promoted to Primary…ODI will still think it is at the ‘other’ site. Will this break the actual agents running the scenarios?
    Where does one find the Oracle Best Practice/recommendations for how to DR ODI properly?
    We are looking for a solution that will allow a graceful switchover/failover with minimal manual re-configuration.

    user8804554 wrote:
    Hi all,
    I m currently testing external components with Windows Server and I want to test Oracle 11g R2.
    The only resource I have is this website and the only binaries seem to be for Linux OS.You have one other HUGE resource that, while it won't answer your current question, you'd better start getting familiar with if you are going to use Oracle. That is the complete and official documentation, found at tahiti.oracle.com
    >
    Does anybody know how I can upgrade my Oracle 11.1.0.7 version to the R2 release?
    Thanks,
    Bertrand

  • How to establish the ODBC connectivity for Hyperion Brio

    Hi Every One,
    Please some one let me know how to establish the ODBC connectivity for Hyperion Brio/ interactive reporting studio.?
    Thanks & Regards,
    Raj

    check out the manual
    http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/ir_user.pdf
    chapter 15
    Edited by: [email protected] on Feb 9, 2010 7:00 AM

  • HOW TO RESOLVE(Test failed: The Network Adapter could not establish the connection)

    Hii
    I want to create new databse as sysdba in jdev.I followed the steps as given in
    Oracle JDeveloper 11g Release 2 Tutorials - Designing and Building Database Tables
    In step 7 create database user and database connection, I am not able to do that and getting the error
    (Test failed: The Network Adapter could not establish the connection).
    Please help me.

    Hi,
    Could you please provide all value you pass to the connection properties on the connection creation panel? First of all, you should choose "Generic JDBC" as the connection type in order to use BDB SQL JDBC driver.
    Regards,
    Cindy

  • SQL Developer 1.5 - The Network Adapter could not establish the connection

    I was using SQL Developer 1.2 until this afternoon. I saw that 1.5 was available so I decided to try it out.
    Unfortunately, I cannot connect. I've tried connecting the same way I've done with 1.2 and it gives me the error:
    "Io exception: The Network Adapter could not establish the connection"
    No firewall changes, tns changes have been done the whole 10 minutes I was transitioning over from 1.2 to 1.5.
    Any ideas how I can get 1.5 to connect?

    Hi Echoi ,
    1/Do you want us to look at the tnsnames.ora and see if we spot anything?
    2/There are complications with existing ORACLE_HOME s:
    Re: 1.5 not working at all for me
    post from dooneill:
    Hi Thomas,
    SQL Developer does pick up the JDBC drivers from your local ORACLE_HOME.
    To ensure your using the shipped JDBC drivers you could use the following small script.
    I would appreciate if you could tell me if this works and what version of Oracle you have installed locally.
    1) Close SQL Developer
    2) Create a sqldeveloper.cmd file in the SQL Developer root directory
    3) With the following contents
    SET ORACLE_HOME=%CD%
    start sqldeveloper.exe
    4) Run sqldeveloper.cmd
    Thanks
    Dermot.
    -Turloch

  • How to check verison of Best Practice Baseline in existing ECC system?

    Hi Expert,
    How to check verison of Best Practice Baseline in existing ECC system such as v1.603 or v1.604?
    Any help will be appriciate.
    Sayan

    Dear,
    Please go to https://websmp201.sap-ag.de/bestpractices and click on Baseline packages then on right hand side you will see that On which release is SAP Best Practices Baseline package which version is applicable.
    If you are on EHP4 then you can use the v1.604.
    How to Get SAP Best Practices Data Files for Installation (pdf, 278 KB) please refer this link,
    https://websmp201.sap-ag.de/~sapidb/011000358700000421882008E.pdf
    Hope it will help you.
    Regards,
    R.Brahmankar

  • Failure-Io Exception:The network adapter could not establish the connection

    Hi,
    I am new to sql developer and need help regarding establishing connection in my PC.
    I gave the following details for establishing connection.
    Connection Name: DB
    Username: myDB
    passwd: xxxxx
    Role: Default
    Connection Type: Basic
    Host Name: localhost
    Port: 1521
    SID: xe
    When I tested the connection the following error occured:
    Failure -Io Exception: The network adapter could not establish the connection
    Please help me out.
    Thanks in advance.

    Some information showing:
    How to check if there is something listening on a machine/port (there are also port scanners like nmap)
    first a success: ctrl - ] typed in by me.
    $ telnet localhost 1521
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    ^]
    telnet> quit
    Connection closed.
    then a fail:
    $ telnet localhost 1522
    Trying 127.0.0.1...
    telnet: Unable to connect to remote host: Connection refused
    $
    Oracle also has tools to get the status of the 'listener' which is listening on the port, including database names for example 'lsnrctl stat' but it may have too many dependencies and privileges required to go into here.
    If you do not have XE, you can install it with very few restrictions.
    -Turloch

  • The Network Adapter could not establish the connection Error Code: 17002

    Hi,
    after upgrade b41 to b49, I get error from subject, without any changes in my app.
    This occurs only on Oracle AS, on standalone OC4J application works OK.
    I use connection defined in persistence.xml:
    <non-jta-data-source>jdbc/MyAppDS</non-jta-data-source>
    and can successfully test this connection in Enterprise manager.
    Also, I tried all tricks mentioned here:
    http://www.websina.com/bugzero/kb/oracle-connection.html
    I know, that this is JDBC layer problem, but I am sure, that my connection is OK, and
    after downgrade to b48 this problem fall away.
    Bye,
    Lumir

    Could you provide the full stack trace to the exception.Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b50-beta3 (06/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Výjimka vstupu/výstupu: The Network Adapter could not establish the connection
    Error Code: 17002
         at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305)
         at oracle.toplink.essentials.jndi.JNDIConnector.connect(JNDIConnector.java:150)
         at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:185)
         at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.connect(DatasourceAccessor.java:233)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.connect(DatabaseAccessor.java:242)
         at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.connect(DatasourceAccessor.java:309)
         at oracle.toplink.essentials.threetier.ConnectionPool.buildConnection(ConnectionPool.java:117)
         at oracle.toplink.essentials.threetier.ExternalConnectionPool.startUp(ExternalConnectionPool.java:135)
         at oracle.toplink.essentials.threetier.ServerSession.connect(ServerSession.java:458)
         at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:586)
         at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:235)
         at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:227)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:126)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:120)
         at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:91)
         at idea.isko.db.service.impl.AbstractServiceImpl.createEntityManager(AbstractServiceImpl.java:77)
    How have you deployed your application exactly, i.e. what is the structure of your ear. I use standard war for deploy.
    Is the DataSource defined in your server, or your application? Defined on server, test on Enterprise manager passed successfully.
    Try using a direct JDBC connection in your persistence.xml (driver/url), does this work?Not work, this same exception.
    How do you access your entity manager? (managed, non-managed, jta, non-jta?)non-managed, non-jta.
    FYI, I make downgrade to build 48, and this works - it is last version without this problem.
    I added some tracing code to my SessionCustomizer:customize():
    DatabaseLogin login = session.getLogin();
    logger.fine("URL is :" + login.getDatabaseURL());
    With build 48, connection defined using toplink.jdbc.* , the output is:
    07/06/11 10:04:36.218 10.1.3.1.0 Started
    07/06/11 10:04:43.593 MyApp: 10.1.3.1.0 Started
    07/06/11 10:05:18.578 MyApp: FINE - Customizing session - directProperties
    07/06/11 10:05:18.578 MyApp: FINE - URL is :jdbc:oracle:thin:@(DESCRIPTION ... (cut)
    07/06/11 10:07:16.875 MyApp: 10.1.3.1.0 Stopped
    And after upgrade to build 50:
    07/06/11 10:10:12.703 10.1.3.1.0 Started
    07/06/11 10:10:30.953 MyApp: 10.1.3.1.0 Started
    07/06/11 10:10:52.281 MyApp: FINE - Customizing session - directProperties
    07/06/11 10:10:52.296 MyApp: FINER - THROW
    Local Exception Stack:
    Exception [TOPLINK-28014] (Oracle TopLink Essentials - 2.0 (Build b50-beta3 (06/07/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
    Exception Description: Exception was thrown while processing property [toplink.session.customizer] with value [idea.jpa.util.ToplinkSessionCustomizer].
    Internal Exception: Exception [TOPLINK-7058] (Oracle TopLink Essentials - 2.0 (Build b50-beta3 (06/07/2007))): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: Invalid Connector [JNDIConnectordatasource name=>null] (must be of type DefaultConnector).
    It seems to me, that Login is not properly initialized when app. run in Oracle AS.
    Bye,
    Lumir

  • "The Network Adapter could not establish the connection" on RAC databases

    I am posting what solved our situation here, in case it helps others:
    We have RAC databases that use SCAN, but also use their Local_Listener ports (because we could not go completely to SCAN due to our applications).
    For some reason, 11.1 Grid Control could see instances if we added them separately, but if we tried to connect to the database & view the performance, it would error out with "The Network Adapter could not establish the connection".
    We had to fix it by manually setting the connect string in every instance and database in the OEM Setup to the non-SCAN VIP/Ports.
    Hopefully this saves someone else hours & hours of troubleshooting. (I know, the day after Grid Control 12 comes out. SOOO helpful. :P )

    Aravind K R wrote:
    java.sql.SQLException: The Network Adapter could not establish the connectionWhere is the Oracle error? I hate this - s/w like Java suppressing the underlying error codes and messages. Just how the hell can one diagnose an error when not knowing exactly what it is? There should be a TNS error code and message.
    From the info you've given, one can only guess. And the following guess is as good as any. Load balancing is requested. Likely your RAC db services are registered on both static and virtual IPs - as the listeners are running listener 1521/tcp end points on both.
    This means the client can get a redirect to connect to a specific listener on a specific IP - and this includes the static IPs. The listener usually passes hostnames (as that is what is configured). If the client cannot resolve that static hostname to an IP, it cannot correct.
    So make sure that the client can resolve both virtual and static hostnames of the RAC - not just the virtual ones.
    If you're client is Windows, update the c:\windows\system32\drivers\etc\hosts file - alternatively register the hostnames with the local DNS.

  • IO Error: The Network Adapter could not establish the connection in oracle

    Hi experts,
    I have oracle developer days installed in my vitrual box machine. The connection to oracle datatase (11.2.0.2) contained in the oracle developer days was working fine via sql developer. I use eclipse to write some java programs to connect the database. However, somehow, I cannot connect the database via sql deveoper anymore. This is the error I got when I tried to connect it via basic connection type:
    Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
    Can anybody shed a light on this issue please. Thanks a lot in advance.

    user571093 wrote:
    Hi experts,
    I have oracle developer days installed in my vitrual box machine. The connection to oracle datatase (11.2.0.2) contained in the oracle developer days was working fine via sql developer. I use eclipse to write some java programs to connect the database. However, somehow, I cannot connect the database via sql deveoper anymore. This is the error I got when I tried to connect it via basic connection type:
    Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
    Can anybody shed a light on this issue please. Thanks a lot in advance.Do you realize & understand that we are NOT standing behind you?
    I, too, am running Oracle Developer Days inside VirtualBox.
    On which system is SQL Developer installed?
    The post errors indicate an OS/networking issue.
    when was last time all worked without error?
    what changed since then?
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • The Network Adapter could not establish the connection - while connecting

    Hi All,
    I have installed OEM 11g Grid Control on Linux 5.3 on Host1.
    I have also installed Oracle Management Agent on Host2.
    I can see that Agent on Host2 is sending stats to Host1 which I can view using Grid Control. However when I try to access Availability/Schema details for the Database instance on Host2, I get the error message "The Network Adapter could not establish the connection".
    I have setup the tns entry in Host database server tnsnames.ora file, I can connect to the database on Host2 from sql*plus in Host1. But from Grid control it is now working.
    Do you know if I need to setup any other configuration?
    Please Note: I can see all information of repository database instance from Grid control. The OMS and Repository databsse runs on the same box.

    Verify that the Agent's URL, as seen in the Grid Console -> Setup -> Agent name page is the same as the value configured for the EMD_URL in the <AGENT_HOME>/sysman/config/emd.properties file.
    Check http://www.myoraclesupports.com/content/how-troubleshoot-communication-between-oracle-management-service-oms-and-grid-agent-componen for other options (though written for 10g most is also valid for GC 11g)
    Eric

  • SQLDeveloper: The Network Adapter could not establish the connection

    I have installed 10.2.0g and am getting the following error 'The Network Adapter could not establish the connection' when testing a new connection in SQLDeveloper.
    I also have 11g installed and can connect successfully on a different port.
    How can i successfully connect to my recently installed 10.2.0g database please?
    many thanks

    As long as u r using the TNS entry, the issue cant lie in the environment variables. It would be true only if you trying to establish a direct connection on the same server.
    1. Pls check the tnsping using the tns entry.
    2. Check if the listener status has the database sid name registered. The issue might be simply with the listener alone.

  • Connection Pooling : Network Adapter could not establish the connection

    Hi,
    We have a client-server application wherein the server has a pooled connection to an Oracle 10i database. The application is developed in Java and we are using Oracle OracleConnectionCacheImpl API to manage the connection pooling( DYNAMIC pooling with a pool size of 5 and we are using ojdbc14.jar)
    On certain occasions when activity is extremely high, the server attemtps to retrieve around 2 million datasets/records. The connection pool runs out of connections and we get the following error :
    com.indigo.utils.DBEngineException: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    at com.indigo.zclasses.DBTradingSource.getConnection(DBTradingSource.java:136)
    at com.indigo.zclasses.DBTradingSource.getTicketMessages(DBTradingSource.java:8033)
    at sun.reflect.GeneratedMethodAccessor749.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.indigo.basketserver.ServerSideUtil.ConfigUtil(ServerSideUtil.java:88)
    at com.indigo.basketserver.RemoteServerImpl.ConfigUtil(RemoteServerImpl.java:543)
    at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:418)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:521)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:325)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:140)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:171)
    at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:149)
    at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:95)
    at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:63)
    at oracle.jdbc.pool.OracleConnectionCacheImpl.getNewPoolOrXAConnection(OracleConnectionCacheImpl.java:547)
    at oracle.jdbc.pool.OracleConnectionCacheImpl.getPooledConnection(OracleConnectionCacheImpl.java:404)
    at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java:298)
    at oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCacheImpl.java:268)
    at com.indigo.zclasses.DBTradingSource.getConnection(DBTradingSource.java:127)
    This is happens in Production and despite our exhaustive efforts,we have been unable to reproduce it in our Testing environment so far.
    A large number of login attempts are seen in the Oracle login monitoring table, around 50,000 but we dont think that should be an issue. At the time, when this problem occurs, there are other processes making connection to the DB without any issues. Also, after sometime, the connection is restored and no exceptions are thrown.
    Any insight into how we could simulate,resolve or monitor this issue would be greatly appreciated.
    Thanks,
    Zuber

    Hi. This a long-known issue, and is caused by the DBMS listener's incoming
    request buffer becoming overloaded by many simultaneous connection
    requests. It will fail some of them. I have seen this with a simple java
    program that calls Driver.connect() identically 20 times in a tight loop.
    Some of the calls will fail in this way, while others will succeed. The
    solution BEA's pool has, is to have a delay option to have the thread
    sleep a bit (half-second to a secod or so) between successive connection
    requests. After that, don't close connections until they're broken. Keep
    them and re-use them.
    HTH,
    Joe Weinstein at BEA Systems

  • How to determine the connection string to a SQLite database, in C# code

    Hello. I'm trying to figure out how to specify the connection string to a SQLite database, I would like to access using the following code:
    string connectionString = null;
    SqlConnection connection;
    SqlCommand command;
    SqlDataAdapter adapter = new SqlDataAdapter();
    DataSet ds1 = new DataSet();
    string sql = "SELECT DataName, Data, Id, UserId, DateLastUpdated FROM MainTable";
    connectionString = "Data Source=C:\\SQLITEDATABASES\\SQLITEDB1.sqlite;Version=3;";
    connection = new SqlConnection(connectionString);
    try
    connection.Open();
    command = new SqlCommand(sql, connection);
    catch
    The value I assigned to the variable connectionString, in the code above, I obtained somewhere from the Internet. It does not work. I'm using Visual Studio 2013, against the file sqlite-netFx451-setup-bundle-x86-2013-1.0.96.0.exe, which
    I installed, and got from
    here.
    My application's App.config file looks as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <configSections>
    </configSections>
    <connectionStrings>
    <add name="DC_Password_Saver.Properties.Settings.DC_Password_SaverConnectionString" connectionString="data source=&quot;C:\Users\patmo_000\Documents\Visual Studio 2013\Projects\DC Password Saver\DC Password Saver\DC Password Saver.db&quot;" providerName="System.Data.SQLite.EF6"/>
    </connectionStrings>
    <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
    </startup>
    </configuration>
    I tried to use the value assigned to connectionString in the XML settings above, replacing single backslash characters with double backslash characters, because the Visual Studio editor flagged them as unrecognizable, and wound up with the
    following.
    SqlDataAdapter adapter = new SqlDataAdapter();
    DataSet ds1 = new DataSet();
    string sql = "SELECT DataName, Data, Id, UserId, DateLastUpdated FROM MainTable";
    connectionString = "data source=&quot;C:\\Users\\patmo_000\\Documents\\Visual Studio 2013\\Projects\\DC Password Saver\\DC Password Saver\\DC Password Saver.db&quot;";
    connection = new SqlConnection(connectionString);
    The above code however does not work either. So again, does anyone know how I can specify in C# code, a connection string to access my SQLite database? Thanks in advance for your reply.

    What does SQLite connection strings has to do with WPF?
    You will find some valid connection strings here:
    https://www.connectionstrings.com/sqlite/
    But you cannot use the SqlConnection class to connect to a SQLite database. You will need to download and add a reference to the System.Data.SQLite library and then use the SQLiteConnection class:
    connection = new System.Data.SQLite.SQLiteConnection(connectionString);
    try
    connection.Open();
    command = new System.Data.SQLite.SQLiteCommand(sql, connection);
    catch
    Please refer to the following article for more information and an example of how to connect and read and write data from an SQLite database using C#:
    http://blog.tigrangasparian.com/2012/02/09/getting-started-with-sqlite-in-c-part-one/.
    There is contains a link where you can download the required assemblies.
    Hope that helps.
    Please remember to mark helpful posts as answer to close your threads and then start a new thread in an approproate forum if you have a new question.

Maybe you are looking for