|
This section provides links to quick information on how to get connected to a Pervasive.SQL database.
These examples should only supplement the full documentation for each access method. For each access method, there are links to more detailed information.
Each sample references the Course table in the DEMODATA sample database, which is included with Pervasive.SQL.
For complete information on ADO/OLE DB tasks, see
Dim rs As New ADODB.Recordset rs.Open "Course", "Provider=PervasiveOLEDB;Data Source=DEMODATA", adOpenDynamic, adLockOptimistic, adCmdTableDirect ' work with data rs.Close
For complete information on JDBC tasks, see
Class.forName("com.pervasive.jdbc.v2.Driver");
Connection con =
DriverManager.getConnection("jdbc:pervasive://
localhost:1583/DEMODATA");
PreparedStatement stmt = con.prepareStatement("SELECT *
FROM Course ORDER BY Name");
ResultSet rs = stmt.executeQuery();
For complete information on Java Class Library tasks, see
Session session = Driver.establishSession(); Database db = session.connectToDatabase(); db.setDictionaryLoc("c:\\PVSW\\DEMODATA");
Pervasive.SQL allows an application to perform a DSN-less connection (connecting to the SQL engine without using a DSN) :
The following steps should be used when running locally on the Server or from a Remote Client. This method works with Server as well as Workstation/WorkGroup Engines.
Driver={Pervasive ODBC Client
Interface};ServerName=myserver;dbq=@DEMODATA;
Note
Releases earlier than Pervasive.SQL 2000 (SP3) supported DSN-less connections only for applications running local to the engine (i.e. running on the same machine where the engines were running). However, the format of the Driver string changed starting with Pervasive.SQL 2000i (SP3). Any applications using DSN-less connections will have to be modified as shown above, and recompiled in order to run without a DSN under Pervasive.SQL 2000 (SP2a) or earlier.
|
Chapter contents
Prev topic: Choosing a Development Tool
|