Changeset: 073ee535234b for monetdb-java
URL: http://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=073ee535234b
Added Files:
        src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java.in
Removed Files:
        pom.xml
        src/main/java/nl/cwi/monetdb/embedded/env/AbstractConnectionResult.java
        src/main/java/nl/cwi/monetdb/embedded/env/JDBCEmbeddedConnection.java
        src/main/java/nl/cwi/monetdb/embedded/env/MonetDBEmbeddedConnection.java
        src/main/java/nl/cwi/monetdb/embedded/env/MonetDBEmbeddedDatabase.java
        src/main/java/nl/cwi/monetdb/embedded/env/MonetDBEmbeddedException.java
        src/main/java/nl/cwi/monetdb/embedded/mapping/AbstractColumn.java
        src/main/java/nl/cwi/monetdb/embedded/mapping/AbstractResultTable.java
        src/main/java/nl/cwi/monetdb/embedded/mapping/AbstractRowSet.java
        src/main/java/nl/cwi/monetdb/embedded/mapping/MonetDBRow.java
        src/main/java/nl/cwi/monetdb/embedded/mapping/MonetDBToJavaMapping.java
        
src/main/java/nl/cwi/monetdb/embedded/resultset/AbstractQueryResultSetColumn.java
        src/main/java/nl/cwi/monetdb/embedded/resultset/QueryResultRowSet.java
        src/main/java/nl/cwi/monetdb/embedded/resultset/QueryResultSet.java
        
src/main/java/nl/cwi/monetdb/embedded/resultset/QueryResultSetBooleanColumn.java
        
src/main/java/nl/cwi/monetdb/embedded/resultset/QueryResultSetByteColumn.java
        
src/main/java/nl/cwi/monetdb/embedded/resultset/QueryResultSetDoubleColumn.java
        
src/main/java/nl/cwi/monetdb/embedded/resultset/QueryResultSetFloatColumn.java
        
src/main/java/nl/cwi/monetdb/embedded/resultset/QueryResultSetIntColumn.java
        
src/main/java/nl/cwi/monetdb/embedded/resultset/QueryResultSetLongColumn.java
        
src/main/java/nl/cwi/monetdb/embedded/resultset/QueryResultSetObjectColumn.java
        
src/main/java/nl/cwi/monetdb/embedded/resultset/QueryResultSetShortColumn.java
        src/main/java/nl/cwi/monetdb/embedded/resultset/UpdateResultSet.java
        
src/main/java/nl/cwi/monetdb/embedded/tables/IMonetDBTableBaseIterator.java
        src/main/java/nl/cwi/monetdb/embedded/tables/IMonetDBTableCursor.java
        src/main/java/nl/cwi/monetdb/embedded/tables/MonetDBTable.java
        src/main/java/nl/cwi/monetdb/embedded/tables/MonetDBTableColumn.java
        src/main/java/nl/cwi/monetdb/embedded/tables/RowIterator.java
        src/main/java/nl/cwi/monetdb/embedded/utils/StringEscaper.java
        
src/main/java/nl/cwi/monetdb/mcl/connection/MonetDBConnectionFactory.java
        
src/main/java/nl/cwi/monetdb/mcl/connection/embedded/EmbeddedConnection.java
        
src/main/java/nl/cwi/monetdb/mcl/connection/embedded/EmbeddedLanguage.java
        src/main/java/nl/cwi/monetdb/mcl/connection/helpers/Debugger.java
        src/main/java/nl/cwi/monetdb/mcl/protocol/embedded/EmbeddedProtocol.java
Modified Files:
        build.xml
        example/PreparedExample.java
        example/SQLImport.java
        example/SQLcopyinto.java
        src/main/java/nl/cwi/monetdb/client/JMonetDB.java
        src/main/java/nl/cwi/monetdb/client/JdbcClient.java
        src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
        src/main/java/nl/cwi/monetdb/mcl/connection/mapi/MapiConnection.java
        src/main/java/nl/cwi/monetdb/mcl/protocol/oldmapi/OldMapiProtocol.java
        src/main/java/nl/cwi/monetdb/merovingian/Control.java
        src/main/java/nl/cwi/monetdb/merovingian/SabaothDB.java
        src/main/java/nl/cwi/monetdb/util/CmdLineOpts.java
        src/main/java/nl/cwi/monetdb/util/Exporter.java
        src/main/java/nl/cwi/monetdb/util/SQLExporter.java
        src/main/java/nl/cwi/monetdb/util/SQLRestore.java
        src/main/java/nl/cwi/monetdb/util/XMLExporter.java
Branch: embedded
Log Message:

Ok. Now everything compiles back with Ant again. Moved the Embedded stuff to 
the temporary MonetDBJavaLite repository before moving into the suggested 
MonetDBLite repository. The soon generated Embedded Connection jar will have a 
dependency on the regular JDBC driver jar. The JDBC driver jar is independent, 
however if attempted to create an Embedded Connection with will try to load the 
respective class from the class loader, failing if the Embedded Connection jar 
is not present. If anyone in the group has expertise on Java Class dynamic 
loading, please contact me because there might be issues on this. Removed the 
pom.xml file because the regular maven compilation fails.


diffs (truncated from 5836 to 300 lines):

diff --git a/build.xml b/build.xml
--- a/build.xml
+++ b/build.xml
@@ -31,7 +31,6 @@ Copyright 1997 - July 2008 CWI, August 2
   <property name="util-package"         value="nl/cwi/monetdb/util" />
   <property name="mero-control-package" value="nl/cwi/monetdb/merovingian" />
 
-  <property file="build.local.properties" />
   <property file="build.properties" />
 
   <property name="jdbc-jar"
@@ -258,7 +257,7 @@ Copyright 1997 - July 2008 CWI, August 2
   </target>
 
   <!--
-  This generates MonetDriver.java from its ".java.in" equivalents.  It's
+  This generates MonetDriver.java.in from its ".java.in" equivalents.  It's
   required for importing the driver version properties.
   -->
   <target name="driver" depends="prepare" unless="uptodate.drivers">
@@ -282,7 +281,7 @@ Copyright 1997 - July 2008 CWI, August 2
     <!-- now copy and filter the file -->
        <copy file="${srcdir}/${jdbc-package}/MonetDriver.java.in"
          overwrite="true"
-         tofile="${srcdir}/${jdbc-package}/MonetDriver.java"
+         tofile="src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java.in"
          filtering="yes" />
 
     <echo message="Configured build for the ${JDBC_MAJOR}.${JDBC_MINOR} 
(${JDBC_VER_SUFFIX}) edition driver" />
diff --git a/example/PreparedExample.java b/example/PreparedExample.java
--- a/example/PreparedExample.java
+++ b/example/PreparedExample.java
@@ -15,8 +15,7 @@ import java.sql.*;
  */
 public class PreparedExample {
        public static void main(String[] args) throws Exception {
-               // make sure the driver is loaded
-               Class.forName("nl.cwi.monetdb.jdbc.MonetDriver");
+               //Class.forName("nl.cwi.monetdb.jdbc.MonetDriver");
                Connection con = 
DriverManager.getConnection("jdbc:monetdb://localhost/notused", "monetdb", 
"monetdb");
                PreparedStatement st = con.prepareStatement("SELECT ? AS a1, ? 
AS a2");
                ResultSet rs;
diff --git a/example/SQLImport.java b/example/SQLImport.java
--- a/example/SQLImport.java
+++ b/example/SQLImport.java
@@ -37,8 +37,7 @@ public class SQLImport {
                // open the file
                BufferedReader fr = new BufferedReader(new FileReader(args[0]));
 
-               // make sure the driver is loaded
-               Class.forName("nl.cwi.monetdb.jdbc.MonetDriver");
+               // Class.forName("nl.cwi.monetdb.jdbc.MonetDriver");
                // request a connection suitable for Monet from the driver 
manager
                // note that the database specifier is currently not 
implemented, for
                // Monet itself can't access multiple databases.
diff --git a/example/SQLcopyinto.java b/example/SQLcopyinto.java
--- a/example/SQLcopyinto.java
+++ b/example/SQLcopyinto.java
@@ -10,6 +10,9 @@ import java.sql.*;
 import java.io.*;
 import java.util.*;
 
+import nl.cwi.monetdb.mcl.connection.mapi.MapiConnection;
+import nl.cwi.monetdb.mcl.protocol.AbstractProtocol;
+
 /**
  * This example demonstrates how the MonetDB JDBC driver can facilitate
  * in performing COPY INTO sequences.  This is mainly meant to show how
@@ -20,12 +23,9 @@ import java.util.*;
 
 public class SQLcopyinto {
        public static void main(String[] args) throws Exception {
-               // make sure the driver is loaded
-               Class.forName("nl.cwi.monetdb.jdbc.MonetDriver");
-               // request a connection suitable for Monet from the driver 
manager
-               // note that the database specifier is currently not 
implemented, for
-               // Monet itself can't access multiple databases.
-               // turn on debugging
+               // Class.forName("nl.cwi.monetdb.jdbc.MonetDriver");
+               // request a connection suitable for Monet from the driver 
manager note that the database specifier is currently
+               // not implemented, for Monet itself can't access multiple 
databases turn on debugging
                Connection con = 
DriverManager.getConnection("jdbc:monetdb://localhost/database", "monetdb", 
"monetdb");
 
                // get a statement to execute on
@@ -43,24 +43,19 @@ public class SQLcopyinto {
                // of course also be done simultaneously with the JDBC
                // connection being kept connected
 
-               /*DeleteMe server = new DeleteMe("localhost", 50000, "monetdb", 
"monetdb", false, "sql", "SHA256");
-
-               server.setDatabase("database");
-               server.setLanguage("sql");
+               MapiConnection server = new MapiConnection(null, 
"database",null, "sql", true,"localhost", 50000 );
 
                try {
-                       List warning = 
-                               server.connect( "monetdb", "monetdb");
+                       List warning = server.connect("monetdb", "monetdb");
                        if (warning != null) {
                                for (Object aWarning : warning) {
                                        System.out.println(aWarning.toString());
                                }
                        }
+                       AbstractProtocol oldmMapiProtocol = 
server.getProtocol();
 
-                       AbstractMCLReader in = server.getReader();
-                       AbstractMCLWriter out = server.getWriter();
-
-                       String error = in.waitForPrompt();
+                       oldmMapiProtocol.waitUntilPrompt();
+                       String error = 
oldmMapiProtocol.getRemainingStringLine(0);
                        if (error != null)
                                throw new Exception(error);
 
@@ -68,15 +63,13 @@ public class SQLcopyinto {
                        // the leading 's' is essential, since it is a protocol
                        // marker that should not be omitted, likewise the
                        // trailing semicolon
-                       out.write('s');
-                       out.write(query);
-                       out.newLine();
+                       oldmMapiProtocol.writeNextQuery("s", query, "\n");
+
                        for (int i = 0; i < 100; i++) {
-                               out.write("" + i + ",val_" + i);
-                               out.newLine();
+                               oldmMapiProtocol.writeNextQuery(null, "" + i + 
",val_" + i, "\n");
                        }
-                       out.writeLine(""); // need this one for synchronisation 
over flush()
-                       error = in.waitForPrompt();
+                       oldmMapiProtocol.waitUntilPrompt();
+                       error = oldmMapiProtocol.getRemainingStringLine(0);
                        if (error != null)
                                throw new Exception(error);
                        // disconnect from server
@@ -103,7 +96,7 @@ public class SQLcopyinto {
                // free resources, close the statement
                stmt.close();
                // close the connection with the database
-               con.close();*/
+               con.close();
 
        }
 }
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
--- a/pom.xml
+++ /dev/null
@@ -1,152 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
-       http://maven.apache.org/xsd/maven-4.0.0.xsd";
-       xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
-       <modelVersion>4.0.0</modelVersion>
-
-       <groupId>monetdb</groupId>
-       <artifactId>monetdb-jdbc</artifactId>
-       <version>2.23</version>
-       <name>${project.groupId}:${project.artifactId}</name>
-       <description>MonetDB JDBC driver</description>
-       <url>https://www.monetdb.org</url>
-
-       <licenses>
-               <license>
-                       <name>Mozilla Public License, Version 2.0</name>
-                       <url>https://www.mozilla.org/MPL/2.0/</url>
-               </license>
-       </licenses>
-
-       <developers>
-               <developer>
-                       <name>Sjoerd Mullender</name>
-                       <email>[email protected]</email>
-                       <organization>MonetDB</organization>
-                       
<organizationUrl>https://www.monetdb.org</organizationUrl>
-               </developer>
-               <developer>
-                       <name>Dimitar Nedev</name>
-                       <email>[email protected]</email>
-                       <organization>MonetDB Solutions</organization>
-                       
<organizationUrl>https://www.monetdbsolutions.com</organizationUrl>
-               </developer>
-       </developers>
-
-       <distributionManagement>
-               <snapshotRepository>
-                       <id>ossrh</id>
-                       
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
-               </snapshotRepository>
-               <repository>
-                       <id>ossrh</id>
-                       
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
-               </repository>
-       </distributionManagement>
-
-       <scm>
-               
<connection>scm:hg:https://dev.monetdb.org/hg/MonetDB/</connection>
-               
<developerConnection>scm:hg:ssh://[email protected]/MonetDB/</developerConnection>
-               <url>https://dev.monetdb.org/hg/MonetDB/</url>
-       </scm>
-
-       <properties>
-               
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-               <jdbc.sources>nl/cwi/monetdb/jdbc/**/*.java</jdbc.sources>
-               <mcl.sources>nl/cwi/monetdb/mcl/**/*.java</mcl.sources>
-       </properties>
-
-       <build>
-               <plugins>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-compiler-plugin</artifactId>
-                               <version>3.2</version>
-                               <configuration>
-                                       <includes>
-                                               
<include>${jdbc.sources}</include>
-                                               
<include>${mcl.sources}</include>
-                                       </includes>
-                                       <source>1.7</source>
-                                       <target>1.7</target>
-                               </configuration>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-source-plugin</artifactId>
-                               <version>2.2.1</version>
-                               <executions>
-                                       <execution>
-                                               <id>attach-sources</id>
-                                               <goals>
-                                                       <goal>jar-no-fork</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                               <configuration>
-                                       <includes>
-                                               
<include>${jdbc.sources}</include>
-                                               
<include>${mcl.sources}</include>
-                                       </includes>
-                               </configuration>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-javadoc-plugin</artifactId>
-                               <version>2.9.1</version>
-                               <executions>
-                                       <execution>
-                                               <id>attach-javadocs</id>
-                                               <goals>
-                                                       <goal>jar</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                               <configuration>
-                                       <sourceFileIncludes>
-                                               
<include>${jdbc.sources}</include>
-                                               
<include>${mcl.sources}</include>
-                                       </sourceFileIncludes>
-                                       
<additionalparam>-Xdoclint:none</additionalparam>
-                               </configuration>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.sonatype.plugins</groupId>
-                               
<artifactId>nexus-staging-maven-plugin</artifactId>
-                               <version>1.6.3</version>
-                               <extensions>true</extensions>
-                               <configuration>
-                                       <serverId>ossrh</serverId>
-                                       
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
-                                       
<autoReleaseAfterClose>false</autoReleaseAfterClose>
-                               </configuration>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-release-plugin</artifactId>
-                               <version>2.5</version>
-                               <configuration>
-                                       
<autoVersionSubmodules>true</autoVersionSubmodules>
-                                       
<useReleaseProfile>false</useReleaseProfile>
-                                       
<releaseProfiles>release</releaseProfiles>
-                                       <goals>deploy</goals>
-                               </configuration>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-gpg-plugin</artifactId>
-                               <version>1.5</version>
-                               <executions>
-                                       <execution>
-                                               <id>sign-artifacts</id>
-                                               <phase>verify</phase>
-                                               <goals>
-                                                       <goal>sign</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                       </plugin>
-               </plugins>
-       </build>
-
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to