I am writing a service for editing sql server data tables from a java web front end. I am using the jtds jdbc driver. It has been relatively painless until now. I've had some performance issues but it hasn't been bad enough to track down the root cause.
Yesterday the server that I've been using for testing died completely. No hope of rebuilding for a few days, no backups available :(. So I downloaded the SQL Server 2005 express edition and installed it on my laptop. A new feature for MS-SQL since the last time I used it is instance names. I made the mistake of giving my SQL install an instance name and no matter what I did I couldn't get the jtds driver to connect. Supposedly you can create an instance property to be passed when creating a connection but I never got that to work.
So today I re-installed with the default instance name and badabing it all works. No great lesson here but perhaps a bit of help to someone else having the same issue.
Thursday, March 27, 2008
Friday, March 7, 2008
It's here! PikaPika '08
The '08 version of the PikaPika movie is here. PikaPika is the art of drawing pictures (usually moving) using flashlights and long exposures. More free time and talent than I posess but it won't stop me from enjoying the hard work of the filmmakers!
Pika Pika!"
Pika Pika!"
Sunday, March 2, 2008
Who wants to live for a thousand years?
Interesting talk from '06 at TED. Aubrey de Grey says we can avoid aging. From his talk it doesn't seem that I'm likely to reach the living escape velocity but perhaps my children will.
Saturday, March 1, 2008
First Post
I've been coding for a long, long time. Doesn't mean that I am any good at it but I do have the benefit of almost three decades of screwing up (some people call this experience). In that time I've worked with Microsoft development tools on many occasions. Starting with vb3 and including vb4 (16 bit), vb6, vc/c++ and .asp programming. With the exception of the c/c++ I have not had much positive to say about my experience. Nevertheless, I periodically try the latest and greatest to see what is new and if the promise of easy development is any closer to being realized.
Earlier this week I downloaded the 2008 Visual C# Express Edition with the idea of porting an ancient paradox for dos application to .net. One of the decisions to make is the database. Express Edition comes with something called SQL Server Compact Edition(SQLCE). Apparently this is a Windows CE product ported to the rest of the Windows family. Unfortunately it is not completely compatible with it's larger siblings.
I have a csv like export file from the paradox tables. I was hoping for an easy way to load this into SQLCE . I finally got the data for one table loaded but it wasn't trivial. I'm considering switching to something like mysql just to avoid headaches like this. We'll see.
I made several attempts using the built in data facilities in the IDE. I wrote a quick cpython program to convert the .csv file into properly formatted sql inserts. I also wrote a quick custom c# program to let me execute sql pasted into a textbox and had no luck there for two reasons.
I've always enjoyed python programming and one of the things I've wanted to check out about .net is IronPython. So, I got the 2.0 Alpha8 release (alpha!) and wrote a quick bit of code in the interactive shell to load the data. Here is the cut and pasted code so no brickbats for bad formatting:
>>> conn = SqlCeConnection.setConnectionString("Data Source=database.sdf")
>>> cmd.Connection = conn
>>> conn.Open()
>>> inp = open("C:\\newMsSqlAccount.sql","r")
>>> for line in inp:
... cmd.CommandText = line
... rows = cmd.ExecuteNonQuery();
... print rows
And that was it, 26k rows loaded in less than a minute. I am somewhat happier now.
Earlier this week I downloaded the 2008 Visual C# Express Edition with the idea of porting an ancient paradox for dos application to .net. One of the decisions to make is the database. Express Edition comes with something called SQL Server Compact Edition(SQLCE). Apparently this is a Windows CE product ported to the rest of the Windows family. Unfortunately it is not completely compatible with it's larger siblings.
I have a csv like export file from the paradox tables. I was hoping for an easy way to load this into SQLCE . I finally got the data for one table loaded but it wasn't trivial. I'm considering switching to something like mysql just to avoid headaches like this. We'll see.
I made several attempts using the built in data facilities in the IDE. I wrote a quick cpython program to convert the .csv file into properly formatted sql inserts. I also wrote a quick custom c# program to let me execute sql pasted into a textbox and had no luck there for two reasons.
- SQLCE does not like to execute multiple SQL statements at once ie no 'INSERT foo; INSERT bar;' each statement needs to be executed seperately.
- I could not get my statements to insert unless I explicitly put NULL in any field where there was not a value to be inserted
I've always enjoyed python programming and one of the things I've wanted to check out about .net is IronPython. So, I got the 2.0 Alpha8 release (alpha!) and wrote a quick bit of code in the interactive shell to load the data. Here is the cut and pasted code so no brickbats for bad formatting:
>>> import clr>>> cmd = SqlCeCommand()
>>> clr.AddReference('System.Data.SqlServerCe')
>>> from System.Data.SqlServerCe import *
>>> conn = SqlCeConnection()
>>> conn = SqlCeConnection.setConnectionString("Data Source=database.sdf")
>>> cmd.Connection = conn
>>> conn.Open()
>>> inp = open("C:\\newMsSqlAccount.sql","r")
>>> for line in inp:
... cmd.CommandText = line
... rows = cmd.ExecuteNonQuery();
... print rows
And that was it, 26k rows loaded in less than a minute. I am somewhat happier now.
Subscribe to:
Posts (Atom)